anurag008w commited on
Commit
27f94dd
Β·
1 Parent(s): 74e4d41

resolve merge conflict

Browse files
Files changed (2) hide show
  1. iframe-fix.cjs +4 -0
  2. start.sh +36 -0
iframe-fix.cjs CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  /**
2
  * iframe-fix.cjs β€” Node.js preload script
3
  *
 
1
+ process.on('uncaughtException', function(err) {
2
+ if (err.code === 'EPIPE') return;
3
+ throw err;
4
+ });
5
  /**
6
  * iframe-fix.cjs β€” Node.js preload script
7
  *
start.sh CHANGED
@@ -536,6 +536,29 @@ if [ -n "${CLOUDFLARE_WORKERS_TOKEN:-}" ]; then
536
  python3 /home/node/app/cloudflare-keepalive-setup.py || true
537
  fi
538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  # ── Re-install previously installed plugins ──
540
  EXISTING_CONFIG="/home/node/.openclaw/openclaw.json"
541
  if [ -f "$EXISTING_CONFIG" ]; then
@@ -557,6 +580,19 @@ if [ -f "$EXISTING_CONFIG" ]; then
557
  fi
558
  fi
559
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  # ── Launch gateway ──
561
  echo "Launching OpenClaw gateway on port 7860..."
562
 
 
536
  python3 /home/node/app/cloudflare-keepalive-setup.py || true
537
  fi
538
 
539
+ # ── Write shell capture wrappers to .bashrc ──
540
+ STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
541
+ cat > /home/node/.bashrc << 'BASHRC'
542
+ STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
543
+ _hc_append() {
544
+ local line="$*"
545
+ grep -qxF "$line" "$STARTUP_FILE" 2>/dev/null || echo "$line" >> "$STARTUP_FILE"
546
+ }
547
+ apt-get() {
548
+ command apt-get "$@"
549
+ [[ "$1" == "install" ]] && _hc_append "apt-get install -y ${@:2}"
550
+ }
551
+ apt() {
552
+ command apt "$@"
553
+ [[ "$1" == "install" ]] && _hc_append "apt-get install -y ${@:2}"
554
+ }
555
+ pip() { command pip "$@"; [[ "$1" == "install" ]] && _hc_append "pip install ${@:2}"; }
556
+ pip3() { command pip3 "$@"; [[ "$1" == "install" ]] && _hc_append "pip3 install ${@:2}"; }
557
+ npm() { command npm "$@"; [[ "$1" == "install" && "$2" == "-g" ]] && _hc_append "npm install -g ${@:3}"; }
558
+ openclaw() { command openclaw "$@"; [[ "$1" == "plugins" && "$2" == "install" ]] && _hc_append "openclaw plugins install ${@:3}"; }
559
+ BASHRC
560
+ echo "Shell capture wrappers ready."
561
+
562
  # ── Re-install previously installed plugins ──
563
  EXISTING_CONFIG="/home/node/.openclaw/openclaw.json"
564
  if [ -f "$EXISTING_CONFIG" ]; then
 
580
  fi
581
  fi
582
 
583
+ # ── Run workspace startup script ──
584
+ STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
585
+ if [ ! -f "$STARTUP_FILE" ]; then
586
+ touch "$STARTUP_FILE"
587
+ chmod +x "$STARTUP_FILE"
588
+ echo "Created workspace/startup.sh"
589
+ fi
590
+ if [ -s "$STARTUP_FILE" ]; then
591
+ echo "Running workspace/startup.sh..."
592
+ bash "$STARTUP_FILE" || echo "Warning: startup.sh had errors, continuing..."
593
+ echo "Startup script complete."
594
+ fi
595
+
596
  # ── Launch gateway ──
597
  echo "Launching OpenClaw gateway on port 7860..."
598