deploy: filter git: packages (husky postinstall crashes container sessions)
This commit is contained in:
@@ -23,9 +23,26 @@ rsync -a --delete \
|
|||||||
--exclude 'trust.json' \
|
--exclude 'trust.json' \
|
||||||
--exclude 'mcp-*' \
|
--exclude 'mcp-*' \
|
||||||
--exclude 'run-history*' \
|
--exclude 'run-history*' \
|
||||||
--exclude 'vibes/' \
|
--exclude 'vibes' \
|
||||||
--exclude '*.log' \
|
--exclude '*.log' \
|
||||||
--exclude 'scratch/' \
|
--exclude 'scratch/' \
|
||||||
--exclude '.pi/' \
|
--exclude '.pi/' \
|
||||||
"$SRC/" "$DEST/"
|
"$SRC/" "$DEST/"
|
||||||
|
|
||||||
|
# Container sessions cannot run git: package postinstalls (e.g. husky) — keep
|
||||||
|
# registry (npm:) packages only in the baked settings.json.
|
||||||
|
python3 - "$DEST/settings.json" <<'PY'
|
||||||
|
import json, sys
|
||||||
|
p = sys.argv[1]
|
||||||
|
with open(p) as f:
|
||||||
|
s = json.load(f)
|
||||||
|
pkgs = s.get("packages") or []
|
||||||
|
kept = [x for x in pkgs if x.startswith("npm:")]
|
||||||
|
if pkgs != kept:
|
||||||
|
s["packages"] = kept
|
||||||
|
with open(p, "w") as f:
|
||||||
|
json.dump(s, f, indent=2)
|
||||||
|
f.write("\n")
|
||||||
|
print(f"rsync-pi-agent: dropped {len(pkgs) - len(kept)} git: packages from baked settings")
|
||||||
|
PY
|
||||||
echo "rsync-pi-agent: synced $(find "$DEST" -type f | wc -l) files from $SRC"
|
echo "rsync-pi-agent: synced $(find "$DEST" -type f | wc -l) files from $SRC"
|
||||||
|
|||||||
Reference in New Issue
Block a user