From 97d2b09a63cfec9a5006bd2223a1125765641ae9 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 8 Jun 2026 00:56:39 +0000 Subject: [PATCH] fix(cli): change sh to bash in dockerCoreFetchCommand/dockerCoreJson Both functions use 'set -euo pipefail' in the script passed to 'docker exec ... sh -lc', but /bin/sh on Debian (dash) does not support -o pipefail, causing all microservice proxy and e2e API calls to fail with 'sh: 1: set: Illegal option -o pipefail'. Fix: use bash instead of sh, since bash is available in the container. --- scripts/src/e2e.ts | 2 +- scripts/src/microservices.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/src/e2e.ts b/scripts/src/e2e.ts index d650d76f..f1ade193 100644 --- a/scripts/src/e2e.ts +++ b/scripts/src/e2e.ts @@ -1839,7 +1839,7 @@ function dockerCoreJson(path: string, init?: { method?: string; body?: unknown } "export url method body", "bun -e 'const url=process.env.url; const method=process.env.method; const body=process.env.body; fetch(url,{method,body:body?body:undefined,headers:body?{\"content-type\":\"application/json\"}:undefined}).then(async r=>{const text=await r.text(); console.log(JSON.stringify({ok:r.ok,status:r.status,body:text?JSON.parse(text):null})); process.exit(r.ok?0:1);}).catch(e=>{console.error(e); process.exit(1)})'", ].join("\n"); - const command = ["docker", "exec", "unidesk-backend-core", "sh", "-lc", script]; + const command = ["docker", "exec", "unidesk-backend-core", "bash", "-lc", script]; const result = runCommand(command, repoRoot); if (result.exitCode !== 0) return { ok: false, exitCode: result.exitCode, stdout: result.stdout.slice(-1200), stderr: result.stderr.slice(-1200) }; try { diff --git a/scripts/src/microservices.ts b/scripts/src/microservices.ts index 411d45a6..68a61dda 100644 --- a/scripts/src/microservices.ts +++ b/scripts/src/microservices.ts @@ -157,7 +157,7 @@ function dockerCoreFetchCommand(path: string, init?: { method?: string; body?: u "export url method body max_bytes", "bun -e 'const url=process.env.url; const method=process.env.method; const body=process.env.body; const maxBytes=Number(process.env.max_bytes||\"5000000\"); fetch(url,{method,body:body?body:undefined,headers:body?{\"content-type\":\"application/json\"}:undefined}).then(async r=>{const text=await r.text(); const out={ok:r.ok,status:r.status,body:text?JSON.parse(text):null}; const json=JSON.stringify(out); if (Buffer.byteLength(json) > maxBytes) { console.error(\"response too large\"); process.exit(1); } console.log(json); process.exit(r.ok?0:1);}).catch(e=>{console.error(e); process.exit(1)})'", ].join("\n"); - return ["docker", "exec", "unidesk-backend-core", "sh", "-lc", script]; + return ["docker", "exec", "unidesk-backend-core", "bash", "-lc", script]; } interface RelatedContainer {