



















@@ -397,6 +397,20 @@ describe("scripts/crabbox-wrapper", () => {
397397expectGroupedShellCommand(remoteCommand, shellScript);
398398});
399399400+it("bootstraps raw AWS macOS shell scripts with absolute time-prefixed JavaScript commands", () => {
401+const shellScript = "/usr/bin/time -l pnpm --version";
402+const result = runWrapper(
403+"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
404+["run", "--provider", "aws", "--target", "macos", "--shell", "--", shellScript],
405+);
406+407+const output = parseFakeCrabboxOutput(result);
408+const remoteCommand = normalizeShellLineEndings(output.args.at(-1) ?? "");
409+expect(result.status).toBe(0);
410+expect(remoteCommand).toContain("openclaw_crabbox_bootstrap_macos_js");
411+expectGroupedShellCommand(remoteCommand, shellScript);
412+});
413+400414it("bootstraps raw AWS macOS shell scripts with JavaScript control conditions", () => {
401415const shellScript = "if node -e 'process.exit(0)'; then echo ok; fi";
402416const result = runWrapper(
@@ -633,6 +647,27 @@ describe("scripts/crabbox-wrapper", () => {
633647expect(remoteCommand).not.toContain("openclaw_crabbox_bootstrap_macos_js");
634648});
635649650+it("does not bootstrap raw AWS macOS shell scripts for timed command lookup checks", () => {
651+const result = runWrapper(
652+"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
653+[
654+"run",
655+"--provider",
656+"aws",
657+"--target",
658+"macos",
659+"--shell",
660+"--",
661+"/usr/bin/time -l command -v pnpm",
662+],
663+);
664+665+const output = parseFakeCrabboxOutput(result);
666+const remoteCommand = normalizeShellLineEndings(output.args.at(-1) ?? "");
667+expect(result.status).toBe(0);
668+expect(remoteCommand).not.toContain("openclaw_crabbox_bootstrap_macos_js");
669+});
670+636671it("groups shell commands so fallbacks cannot mask AWS macOS bootstrap failures", () => {
637672const result = runWrapper(
638673"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
@@ -1032,6 +1067,27 @@ describe("scripts/crabbox-wrapper", () => {
10321067expect(remoteCommand).toContain(`&& ${shellScript}`);
10331068});
103410691070+it("preserves sparse changed-gate Git bootstrap for absolute time-prefixed shell commands", () => {
1071+const shellScript = "/usr/bin/time -l pnpm check:changed";
1072+const result = runWrapper(
1073+"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
1074+["run", "--provider", "aws", "--shell", "--", shellScript],
1075+{
1076+gitResponses: {
1077+["config\u0000--bool\u0000core.sparseCheckout"]: { stdout: "true\n" },
1078+["status\u0000--porcelain=v1"]: { stdout: "" },
1079+["merge-base\u0000origin/main\u0000HEAD"]: { stdout: "abc123\n" },
1080+},
1081+},
1082+);
1083+1084+const output = parseFakeCrabboxOutput(result);
1085+const remoteCommand = normalizeShellLineEndings(output.args.at(-1) ?? "");
1086+expect(result.status).toBe(0);
1087+expect(remoteCommand).toContain("git init -q");
1088+expect(remoteCommand).toContain(`&& ${shellScript}`);
1089+});
1090+10351091it("does not treat quoted sparse shell text as a changed gate", () => {
10361092const result = runWrapper(
10371093"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。