-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·58 lines (50 loc) · 1.34 KB
/
setup.sh
File metadata and controls
executable file
·58 lines (50 loc) · 1.34 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
#!/bin/bash
set -e
echo "==================================="
echo " PortOS Setup"
echo "==================================="
echo ""
# Check for Node.js
if ! command -v node &> /dev/null; then
echo "Node.js is required but not installed."
echo "Install it from: https://nodejs.org/"
exit 1
fi
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo "Node.js 18+ required (found v$NODE_VERSION)"
exit 1
fi
echo "Installing dependencies..."
npm install
echo ""
echo "Setting up data directory..."
if ! npm run setup; then
echo ""
echo "==================================="
echo " Setup incomplete"
echo "==================================="
echo ""
echo "Fix the issue above, then re-run: ./setup.sh"
echo ""
exit 1
fi
echo ""
# Optional Ghostty setup
read -p "Set up Ghostty terminal themes? (y/N): " setup_ghostty
if [[ $setup_ghostty =~ ^[Yy]$ ]]; then
node scripts/setup-ghostty.js
fi
echo ""
echo "==================================="
echo " Setup Complete!"
echo "==================================="
echo ""
echo "Start PortOS:"
echo " Development: npm run dev"
echo " Production: npm start (or npm run pm2:start)"
echo " Stop: npm run pm2:stop"
echo " Logs: npm run pm2:logs"
echo ""
echo "Access at: http://localhost:5555"
echo ""