mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-10 23:19:09 +02:00
fix(setup): Windows runtime-asset copies prune nested gitignored build output
_link_skill_runtime_assets' exclusion list filters DIRECT children only, so the Windows cp -R real-copy path swept NESTED gitignored build output into the installed skill dirs — concretely, ios-qa/scripts/gen-accessors-tool/ .build is 252MB per install. The IS_WINDOWS real-copy branch now prunes nested node_modules/.build/dist post-copy (find -prune -exec rm -rf). Scoped to _link_skill_runtime_assets ONLY: the generic _link_or_copy stays untouched because runtime roots (browse/, design/) intentionally copy their dist/ binaries. On Unix the assets are symlinks into the working tree, and the prune is gated on the real-copy shape so it can never delete build output from the repo through a link — both directions pinned in test/setup-windows-rerun-refresh.test.ts with fixture trees. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
45b72989e6
commit
2f8638a3e2
@@ -767,6 +767,16 @@ _link_skill_runtime_assets() {
|
||||
rm -rf "$dst_dir/$asset_name"
|
||||
fi
|
||||
_link_or_copy "$asset" "$dst_dir/$asset_name"
|
||||
# P5: the exclusion list above filters DIRECT children only, but the
|
||||
# Windows cp -R copy sweeps NESTED gitignored build output too (concrete:
|
||||
# ios-qa/scripts/gen-accessors-tool/.build is 252MB). Prune post-copy —
|
||||
# a rendered skill install is never a build root, so nested
|
||||
# node_modules/.build/dist are dead weight. ONLY here: the generic
|
||||
# _link_or_copy stays untouched because runtime roots (browse/, design/)
|
||||
# intentionally copy their dist/ binaries.
|
||||
if [ "$IS_WINDOWS" -eq 1 ] && [ -d "$dst_dir/$asset_name" ] && [ ! -L "$dst_dir/$asset_name" ]; then
|
||||
find "$dst_dir/$asset_name" -type d \( -name node_modules -o -name .build -o -name dist \) -prune -exec rm -rf {} + 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user