-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstart.command
More file actions
executable file
·60 lines (50 loc) · 1.46 KB
/
start.command
File metadata and controls
executable file
·60 lines (50 loc) · 1.46 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
56
57
58
59
60
#!/bin/bash
# Crow AI Platform — macOS Launcher
# Double-click this file to start the setup wizard.
cd "$(dirname "$0")"
echo ""
echo "================================================="
echo " Crow AI Platform"
echo "================================================="
echo ""
# Check for Node.js
if ! command -v node &>/dev/null; then
echo " Node.js is required but not installed."
echo ""
echo " Opening the Node.js download page..."
echo " Install Node.js, then double-click this file again."
echo ""
open "https://nodejs.org"
echo " Press any key to exit."
read -n 1
exit 1
fi
NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo " Node.js $(node -v) is too old. Need version 18 or newer."
echo " Opening the Node.js download page..."
open "https://nodejs.org"
echo " Press any key to exit."
read -n 1
exit 1
fi
echo " Node.js $(node -v) — OK"
# Install dependencies if needed
if [ ! -d "node_modules" ]; then
echo " Installing dependencies (first run only)..."
npm install --silent
fi
# Initialize database if needed
if [ ! -f "data/crow.db" ]; then
echo " Initializing database..."
node scripts/init-db.js
fi
# Open the setup wizard
echo ""
echo " Opening setup wizard in your browser..."
echo " If it doesn't open, go to: http://localhost:3456"
echo ""
echo " Press Ctrl+C when you're done with setup."
echo ""
open "http://localhost:3456" 2>/dev/null &
node scripts/wizard-web.js