forked from chriswritescode-dev/opencode-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-dev.sh
More file actions
executable file
·72 lines (57 loc) · 1.85 KB
/
setup-dev.sh
File metadata and controls
executable file
·72 lines (57 loc) · 1.85 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
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
echo "🔍 Checking prerequisites..."
# Check if pnpm is installed (required for workspaces)
if ! command -v pnpm &> /dev/null; then
echo "❌ pnpm is not installed. Please install it with:"
echo " npm install -g pnpm"
exit 1
fi
echo "✅ pnpm is installed"
# Check if Bun is installed (required for backend)
if ! command -v bun &> /dev/null; then
echo "❌ Bun is not installed. Please install it from https://bun.sh"
exit 1
fi
echo "✅ Bun is installed"
# Check if Git is installed
if ! git --version &> /dev/null; then
echo "❌ Git is not installed. Please install Git and try again."
exit 1
fi
echo "✅ Git is installed"
# Check if OpenCode TUI is installed
if ! opencode --version &> /dev/null; then
echo "❌ OpenCode TUI is not installed. Please install it with:"
echo " curl -fsSL https://opencode.ai/install | bash"
exit 1
fi
echo "✅ OpenCode TUI is installed"
# Create workspace directory if it doesn't exist
WORKSPACE_PATH="./workspace"
if [ ! -d "$WORKSPACE_PATH" ]; then
echo "📁 Creating workspace directory at $WORKSPACE_PATH..."
mkdir -p "$WORKSPACE_PATH/repos"
mkdir -p "$WORKSPACE_PATH/config"
echo "✅ Workspace directory created"
else
echo "✅ Workspace directory exists"
fi
# Install dependencies using pnpm (handles workspaces)
echo "📦 Installing dependencies..."
pnpm install
echo "✅ Dependencies installed"
# Copy environment file if it doesn't exist
if [ ! -f ".env" ]; then
echo "📝 Creating environment file..."
cp .env.example .env
echo "✅ Environment file created from .env.example"
else
echo "✅ Environment file exists"
fi
echo "✅ Dev environment ready!"
echo ""
echo "🚀 To start development:"
echo " pnpm dev # Start both backend and frontend"
echo " pnpm dev:backend # Start backend only"
echo " pnpm dev:frontend # Start frontend only"