@@ -1336,6 +1336,29 @@ describe("installer pure helpers", () => {
13361336 expect ( r . stdout . trim ( ) ) . toBe ( "yes" ) ;
13371337 } ) ;
13381338
1339+ it ( "is_source_checkout: rejects bootstrap payload clones even when git metadata exists" , ( ) => {
1340+ const tmp = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "nemoclaw-source-checkout-bootstrap-" ) ) ;
1341+ fs . mkdirSync ( path . join ( tmp , ".git" ) ) ;
1342+ fs . writeFileSync (
1343+ path . join ( tmp , "package.json" ) ,
1344+ JSON . stringify ( { name : "nemoclaw" , version : "0.1.0" } , null , 2 ) ,
1345+ ) ;
1346+ const r = spawnSync (
1347+ "bash" ,
1348+ [
1349+ "-c" ,
1350+ `source "${ INSTALLER } " 2>/dev/null; is_source_checkout "${ tmp } " && echo yes || echo no` ,
1351+ ] ,
1352+ {
1353+ cwd : tmp ,
1354+ encoding : "utf-8" ,
1355+ env : { HOME : tmp , PATH : TEST_SYSTEM_PATH , NEMOCLAW_BOOTSTRAP_PAYLOAD : "1" } ,
1356+ } ,
1357+ ) ;
1358+ expect ( r . status ) . toBe ( 0 ) ;
1359+ expect ( r . stdout . trim ( ) ) . toBe ( "no" ) ;
1360+ } ) ;
1361+
13391362 it ( "resolve_installer_version: falls back to package.json when git tags are unavailable" , ( ) => {
13401363 const tmp = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "nemoclaw-resolve-ver-pkg-" ) ) ;
13411364 fs . mkdirSync ( path . join ( tmp , ".git" ) ) ;
@@ -1822,7 +1845,8 @@ EOS
18221845#!/usr/bin/env bash
18231846set -euo pipefail
18241847# NEMOCLAW_VERSIONED_INSTALLER_PAYLOAD=1
1825- node "$NEMOCLAW_REPO_ROOT/bin/lib/usage-notice.js"
1848+ repo_root="\${NEMOCLAW_REPO_ROOT:-$(cd "$(dirname "\${BASH_SOURCE[0]}")/.." && pwd)}"
1849+ node "$repo_root/bin/lib/usage-notice.js"
18261850EOS
18271851 chmod +x "$target/scripts/install.sh"
18281852 exit 0
0 commit comments