1
0
Эх сурвалжийг харах

Auto-install brainstorm server dependencies on first run

start-server.sh now runs npm install if node_modules is missing.
Fixes broken server when superpowers is installed as a plugin (node_modules
are in .gitignore and not included in the clone).
Jesse Vincent 6 сар өмнө
parent
commit
5e2a89e985

+ 5 - 0
skills/brainstorming/scripts/start-server.sh

@@ -88,6 +88,11 @@ fi
 
 
 cd "$SCRIPT_DIR"
 cd "$SCRIPT_DIR"
 
 
+# Auto-install dependencies if missing
+if [[ ! -d "node_modules" ]]; then
+  npm install --production --no-fund --no-audit 2>&1 | tail -1 >&2
+fi
+
 # Foreground mode for environments that reap detached/background processes.
 # Foreground mode for environments that reap detached/background processes.
 if [[ "$FOREGROUND" == "true" ]]; then
 if [[ "$FOREGROUND" == "true" ]]; then
   echo "$$" > "$PID_FILE"
   echo "$$" > "$PID_FILE"