File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1106,6 +1106,9 @@ function remoteAwsMacosJsBootstrap() {
11061106 `node_version=${ shellQuote ( nodeVersion ) } ;` ,
11071107 'arch="$(uname -m)";' ,
11081108 '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;' ,
11091112 'node_dir="$tool_root/node-v${node_version}-darwin-${node_arch}";' ,
11101113 'export PATH="$node_dir/bin:$pnpm_home:$PATH";' ,
11111114 '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", () => {
274274 expect ( remoteCommand ) . toContain ( "shasum -a 256 -c -" ) ;
275275 expect ( remoteCommand ) . not . toContain ( "set -euo pipefail" ) ;
276276 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' ) ;
277280 expect ( remoteCommand ) . toContain ( "node --version >&2" ) ;
278281 expect ( remoteCommand ) . toContain ( "pnpm --version >&2" ) ;
279282 expectGroupedShellCommand ( remoteCommand , "pnpm --version" ) ;
@@ -328,6 +331,7 @@ describe("scripts/crabbox-wrapper", () => {
328331 "bootstrapping a pinned user-local Node toolchain before the command" ,
329332 ) ;
330333 expect ( output . scriptContent ) . toContain ( "openclaw_crabbox_bootstrap_macos_js" ) ;
334+ expect ( output . scriptContent ) . toContain ( 'if [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR"' ) ;
331335 expect ( output . scriptContent ) . toContain ( "openclaw_crabbox_bootstrap_macos_js || exit $?" ) ;
332336 expect ( output . scriptContent ) . toContain ( `\n${ script } ` ) ;
333337 } ) ;
You can’t perform that action at this time.
0 commit comments