fix: npm-real launcher (npm is a JS symlink, mv broke it); keep .git in vendored git: packages (pi runs git fetch on existing installs)

This commit is contained in:
Raphael Westphal
2026-08-19 11:08:22 +02:00
parent cbf52d2b76
commit 0bfa55a94a
5 changed files with 16 additions and 13 deletions
+7 -8
View File
@@ -1,16 +1,15 @@
#!/bin/sh
# npm shim for headless pi containers: skip lifecycle scripts during package
# installs. pi installs git: packages by running `npm install --omit=dev` in
# each clone; some upstream packages (e.g. husky in rpiv-mono) have
# postinstall scripts that assume a dev machine and fail/crash headless
# installs. --ignore-scripts makes installs safe; runtime code (pure TS/JS
# extensions) does not need lifecycle scripts. Everything else passes through
# to the real npm transparently.
# installs. pi installs git: packages by running `npm install` in each clone;
# some upstream packages (e.g. husky in rpiv-mono) have postinstall scripts
# that assume a dev machine and fail headless installs. --ignore-scripts
# makes installs safe; runtime code (pure TS/JS extensions) does not need
# installs. Everything else passes through to the real npm (docker/npm-real).
case "$1" in
install|i)
exec /usr/bin/npm-real "$@" --ignore-scripts
exec /usr/local/bin/npm-real "$@" --ignore-scripts
;;
*)
exec /usr/bin/npm-real "$@"
exec /usr/local/bin/npm-real "$@"
;;
esac