fix(test): prepare macos runner tmpdir · openclaw/openclaw@7db4b3d
vincentkoc
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1106,6 +1106,9 @@ function remoteAwsMacosJsBootstrap() {
|
1106 | 1106 | `node_version=${shellQuote(nodeVersion)};`, |
1107 | 1107 | 'arch="$(uname -m)";', |
1108 | 1108 | 'case "$arch" in arm64) node_arch=arm64 ;; x86_64) node_arch=x64 ;; *) echo "unsupported macOS arch: $arch" >&2; return 2 ;; esac;', |
| 1109 | +'if [ -z "${TMPDIR:-}" ]; then export TMPDIR="/tmp"; fi;', |
| 1110 | +'if [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR" 2>/dev/null || export TMPDIR="/tmp"; fi;', |
| 1111 | +'if [ ! -d "$TMPDIR" ]; then echo "usable TMPDIR not found: $TMPDIR" >&2; return 1; fi;', |
1109 | 1112 | 'node_dir="$tool_root/node-v${node_version}-darwin-${node_arch}";', |
1110 | 1113 | 'export PATH="$node_dir/bin:$pnpm_home:$PATH";', |
1111 | 1114 | 'if [ ! -x "$node_dir/bin/node" ]; then', |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -274,6 +274,9 @@ describe("scripts/crabbox-wrapper", () => {
|
274 | 274 | expect(remoteCommand).toContain("shasum -a 256 -c -"); |
275 | 275 | expect(remoteCommand).not.toContain("set -euo pipefail"); |
276 | 276 | expect(remoteCommand).toContain('return "$status"'); |
| 277 | +expect(remoteCommand).toContain('if [ -z "${TMPDIR:-}" ]; then export TMPDIR="/tmp"; fi;'); |
| 278 | +expect(remoteCommand).toContain('mkdir -p "$TMPDIR"'); |
| 279 | +expect(remoteCommand).toContain('usable TMPDIR not found: $TMPDIR'); |
277 | 280 | expect(remoteCommand).toContain("node --version >&2"); |
278 | 281 | expect(remoteCommand).toContain("pnpm --version >&2"); |
279 | 282 | expectGroupedShellCommand(remoteCommand, "pnpm --version"); |
@@ -328,6 +331,7 @@ describe("scripts/crabbox-wrapper", () => {
|
328 | 331 | "bootstrapping a pinned user-local Node toolchain before the command", |
329 | 332 | ); |
330 | 333 | expect(output.scriptContent).toContain("openclaw_crabbox_bootstrap_macos_js"); |
| 334 | +expect(output.scriptContent).toContain('if [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR"'); |
331 | 335 | expect(output.scriptContent).toContain("openclaw_crabbox_bootstrap_macos_js || exit $?"); |
332 | 336 | expect(output.scriptContent).toContain(`\n${script}`); |
333 | 337 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。