From dc21fa223bed7ec7621db7c6072b206e43eb7917 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Sun, 22 Feb 2026 12:05:54 -0800 Subject: [PATCH] fix: cloud-init streaming script bash syntax error (#1737) .join("; ") produced invalid bash: &; after background command, do; after for, then; after if. Use newline-joined string instead. Co-authored-by: lab <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) --- cli/package.json | 2 +- cli/src/digitalocean/digitalocean.ts | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cli/package.json b/cli/package.json index beec90b4..872d4658 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.6.9", + "version": "0.6.10", "type": "module", "bin": { "spawn": "cli.js" diff --git a/cli/src/digitalocean/digitalocean.ts b/cli/src/digitalocean/digitalocean.ts index c924b41c..2d048166 100644 --- a/cli/src/digitalocean/digitalocean.ts +++ b/cli/src/digitalocean/digitalocean.ts @@ -762,19 +762,17 @@ export async function waitForCloudInit( // Stream cloud-init output so the user sees progress in real time logStep("Streaming cloud-init output (timeout: 5min)..."); - const remoteScript = [ - 'tail -f /var/log/cloud-init-output.log 2>/dev/null &', - 'TAIL_PID=$!', - 'for i in $(seq 1 150); do', - ' if [ -f /root/.cloud-init-complete ]; then', - ' kill $TAIL_PID 2>/dev/null; wait $TAIL_PID 2>/dev/null', - ' echo ""; echo "--- cloud-init complete ---"; exit 0', - ' fi', - ' sleep 2', - 'done', - 'kill $TAIL_PID 2>/dev/null; wait $TAIL_PID 2>/dev/null', - 'echo ""; echo "--- cloud-init timed out ---"; exit 1', - ].join("; "); + const remoteScript = + 'tail -f /var/log/cloud-init-output.log 2>/dev/null & TAIL_PID=$!\n' + + 'for i in $(seq 1 150); do\n' + + ' if [ -f /root/.cloud-init-complete ]; then\n' + + ' kill $TAIL_PID 2>/dev/null; wait $TAIL_PID 2>/dev/null\n' + + ' echo ""; echo "--- cloud-init complete ---"; exit 0\n' + + ' fi\n' + + ' sleep 2\n' + + 'done\n' + + 'kill $TAIL_PID 2>/dev/null; wait $TAIL_PID 2>/dev/null\n' + + 'echo ""; echo "--- cloud-init timed out ---"; exit 1'; try { const proc = Bun.spawn(