-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·50 lines (40 loc) · 1.09 KB
/
dev.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.09 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
#!/bin/bash
set -e
echo "Starting Alfred Dev Environment..."
# Check for .env
if [ ! -f "cli/.env" ]; then
echo "Warning: cli/.env not found! Using defaults (localhost Ollama)."
fi
# Export env vars if .env exists
if [ -f "cli/.env" ]; then
export $(grep -v '^#' cli/.env | xargs)
fi
# 1. Activate Python Venv
if [ -d "cli/venv" ]; then
echo "Activating Python venv..."
source cli/venv/bin/activate
else
echo "Warning: cli/venv not found. Using system Python."
fi
# 2. Build CLI binary with PyInstaller
echo "Building alfred-cli binary..."
cd cli
pyinstaller --clean --noconfirm alfred-cli.spec
cd ..
# 3. Copy binary into the app bundle
APP_BIN="swift-alfred/Alfred.app/Contents/Resources/bin"
mkdir -p "$APP_BIN"
cp cli/dist/alfred-cli "$APP_BIN/alfred-cli"
# Copy .env into bundle if it exists
if [ -f "cli/.env" ]; then
cp cli/.env "$APP_BIN/.env"
fi
echo "Binary copied to $APP_BIN"
# 4. Build Swift app
echo "Building Swift app..."
cd swift-alfred
swift build
cd ..
echo ""
echo "Done! To run: open swift-alfred/Alfred.app"
echo "Or run CLI directly: ./cli/dist/alfred-cli --help"