-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·55 lines (45 loc) · 1.5 KB
/
setup.sh
File metadata and controls
executable file
·55 lines (45 loc) · 1.5 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -euo pipefail
# Promptterfly Setup Script
# Creates a lightweight venv and installs the package. Safe and idempotent.
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV_DIR="$PROJECT_ROOT/.venv"
PYTHON="${PYTHON:-python3}"
echo "==> Promptterfly Setup"
# Check Python version
if ! "$PYTHON" --version > /dev/null 2>&1; then
echo "Error: python3 not found. Please install Python 3.11+."
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment in $VENV_DIR..."
"$PYTHON" -m venv "$VENV_DIR"
else
echo "Virtual environment already exists at $VENV_DIR"
fi
# Activate venv
source "$VENV_DIR/bin/activate"
# Upgrade pip/setuptools/wheel
echo "Upgrading pip..."
pip install --upgrade pip setuptools wheel
# Install package in editable mode
echo "Installing promptterfly..."
pip install -e "$PROJECT_ROOT"
# Verify installation
echo "Verifying installation..."
if command -v promptterfly > /dev/null 2>&1; then
echo "✓ promptterfly installed successfully"
echo ""
echo "Run 'promptterfly --help' to get started."
echo "If you get 'command not found', try: source $VENV_DIR/bin/activate"
else
echo "✗ Installation seems incomplete. Try manually:"
echo " source $VENV_DIR/bin/activate"
echo " pip install -e $PROJECT_ROOT"
exit 1
fi
echo ""
echo "Setup complete! To use Promptterfly in the future:"
echo " source $VENV_DIR/bin/activate"
echo " promptterfly <command>"