mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
b50b27141c
commit
dc21fa223b
2 changed files with 12 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.6.9",
|
||||
"version": "0.6.10",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue