-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmint.sh
More file actions
executable file
·28 lines (24 loc) · 794 Bytes
/
mint.sh
File metadata and controls
executable file
·28 lines (24 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# mint.sh - Shell wrapper for mint-cli
# This wrapper runs mint.py and then cd's into the new project
# Works in both bash and zsh
if [ -n "$BASH_SOURCE" ]; then
MINT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
else
MINT_DIR="$(cd "$(dirname "$0")" && pwd)"
fi
# Exit if detection fails
if [ ! -f "$MINT_DIR/mint.py" ]; then
echo "Error: Could not find mint.py. Run this script from mint-cli directory."
return 1 2>/dev/null || exit 1
fi
# Run the Python script (pass any arguments)
python3 "$MINT_DIR/mint.py" "$@"
# If successful, cd into the new project
if [ -f "$MINT_DIR/.last_project" ]; then
NEW_PROJECT=$(cat "$MINT_DIR/.last_project")
if [ -d "$NEW_PROJECT" ]; then
cd "$NEW_PROJECT"
echo "📂 Now in: $(pwd)"
fi
fi