From eec69caa5fbaa127c0d5ede84965c2e17bddd8d9 Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Sun, 21 Jun 2026 16:39:25 +0200 Subject: [PATCH] fix(build): resolve shared npm snippet via COLIBRI_REPO + preflight it PR #92 wired the ISO to the shared clawdie-npm-profile.sh but hardcoded ${SCRIPT_DIR}/../colibri and had no existence guard. Every other colibri consumer in build.sh resolves through resolve_colibri_paths (default /home/clawdie/ai/colibri, honoring COLIBRI_REPO), so the hardcoded path diverged from the real build-host layout and ignored the override; a missing file let cat fail silently into a half-written snippet. Now: resolve via resolve_colibri_paths and preflight the file with a clear error pointing at COLIBRI_REPO, matching preflight_colibri_artifacts. Co-Authored-By: Claude Opus 4.8 --- build.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a01940cd..2b3ea457 100755 --- a/build.sh +++ b/build.sh @@ -1467,9 +1467,18 @@ EOF mkdir -p "${MOUNT_POINT}/home/clawdie" "${MOUNT_POINT}/etc/profile.d" "${MOUNT_POINT}/etc/skel" # Install the canonical npm-global profile snippet (shared with agent-jail-bootstrap.sh). + # The snippet lives in colibri; resolve its repo the same way every other + # colibri consumer here does so COLIBRI_REPO overrides are honored. + resolve_colibri_paths + _npm_profile_src="${_resolved_colibri_repo}/packaging/freebsd/clawdie-npm-profile.sh" + if [ ! -f "${_npm_profile_src}" ]; then + echo "ERROR: shared npm profile snippet missing: ${_npm_profile_src}" + echo " It ships in colibri packaging/freebsd/. Set COLIBRI_REPO=/path/to/colibri." + exit 1 + fi { printf 'NPM_PREFIX="/opt/clawdie/npm-global"\n' - cat "${SCRIPT_DIR}/../colibri/packaging/freebsd/clawdie-npm-profile.sh" + cat "${_npm_profile_src}" } > "${MOUNT_POINT}/etc/profile.d/clawdie-npm.sh" chmod 0644 "${MOUNT_POINT}/etc/profile.d/clawdie-npm.sh"