This repository was archived by the owner on May 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathserve.sh
More file actions
executable file
·94 lines (75 loc) · 2.96 KB
/
Copy pathserve.sh
File metadata and controls
executable file
·94 lines (75 loc) · 2.96 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
set -e
PORT=${PORT:-8443}
# Install code-server if missing
if ! command -v code-server &> /dev/null; then
echo "Installing code-server..."
curl -fsSL https://code-server.dev/install.sh | sh
fi
# Set up extension symlink for live development
EXT_DIR="$HOME/.local/share/code-server/extensions"
mkdir -p "$EXT_DIR"
ln -sfn "$(pwd)/src" "$EXT_DIR/roo-cline"
echo "=============================================="
echo "Setting up environment variables for watchers"
echo "=============================================="
# Enable polling for file watchers (helps with symlinks and various environments)
# Chokidar (used by Vite and now esbuild)
export CHOKIDAR_USEPOLLING=true
export CHOKIDAR_INTERVAL=1000
echo "CHOKIDAR_USEPOLLING=$CHOKIDAR_USEPOLLING"
echo "CHOKIDAR_INTERVAL=$CHOKIDAR_INTERVAL"
# Watchpack (used by webpack)
export WATCHPACK_POLLING=true
# TypeScript watch mode - use polling instead of fs events
export TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling
export TSC_WATCHDIRECTORY=UseFsEventsWithFallbackDynamicPolling
# Disable atomic writes so file watchers detect changes properly
export DISABLE_ATOMICWRITES=true
# Set development environment (from .vscode/launch.json)
export NODE_ENV=development
export VSCODE_DEBUG_MODE=true
# Trap to clean up all background processes on exit
cleanup() {
echo "Stopping all processes..."
jobs -p | xargs -r kill 2>/dev/null
}
trap cleanup EXIT INT TERM
# Build all workspace packages first
echo ""
echo "=============================================="
echo "Building workspace packages..."
echo "=============================================="
pnpm build
# Start code-server in background FIRST
echo ""
echo "=============================================="
echo "Starting code-server on port $PORT"
echo "Extension files are at: $(pwd)/src"
echo "Symlinked to: $EXT_DIR/roo-cline"
echo "=============================================="
code-server --auth none --bind-addr 0.0.0.0:${PORT} . &
CODE_SERVER_PID=$!
# Give code-server a moment to start
sleep 2
# Start watchers with explicit env vars using env command
echo ""
echo "=============================================="
echo "Starting file watchers..."
echo "=============================================="
# Run webview watcher (custom chokidar-based script)
env CHOKIDAR_USEPOLLING=true CHOKIDAR_INTERVAL=1000 pnpm --filter @roo-code/vscode-webview dev:watch &
# Run bundle watcher (custom chokidar-based script)
env CHOKIDAR_USEPOLLING=true CHOKIDAR_INTERVAL=1000 pnpm --filter roo-cline watch:bundle &
# Run tsc watcher
env TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling pnpm --filter roo-cline watch:tsc &
echo ""
echo "=============================================="
echo "All processes started!"
echo "code-server running at http://localhost:${PORT}"
echo "Watchers are running - file changes should trigger rebuilds"
echo "Press Ctrl+C to stop all processes"
echo "=============================================="
echo ""
# Wait for all background processes
wait