🐛 fix(thirdparty): prune nested project snapshots

This commit is contained in:
csh
2026-04-01 14:25:25 +08:00
parent a2a697e97b
commit da85d4efbb
4 changed files with 45 additions and 35 deletions
+2 -23
View File
@@ -25,7 +25,6 @@ for entry in data["sources"]:
entry["sync_mode"],
entry["source_list"],
entry.get("skills_subdir", ""),
",".join(entry.get("exclude_skill_dirs", [])),
entry.get("output_name", entry["id"]),
entry.get("platform_config", ""),
entry.get("template_root", ""),
@@ -108,23 +107,6 @@ tracked_skill_exists() {
return 1
}
is_excluded_skill_dir() {
local name="$1"
local exclude_csv="$2"
[ -n "$exclude_csv" ] || return 1
local IFS=','
read -r -a excluded_names <<< "$exclude_csv"
for excluded_name in "${excluded_names[@]}"; do
if [ "$name" = "$excluded_name" ]; then
return 0
fi
done
return 1
}
cd "$REPO_DIR"
git config user.name "$COMMIT_AUTHOR_NAME"
@@ -149,7 +131,7 @@ if ! emit_sources_tsv > "$sources_file"; then
exit 1
fi
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir exclude_skill_dirs output_name platform_config template_root data_dir scripts_dir; do
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do
[ -n "$source_id" ] || continue
if [ -f "$source_list" ]; then
@@ -161,7 +143,7 @@ while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_su
done < "$sources_file"
declare -A owners=()
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir exclude_skill_dirs output_name platform_config template_root data_dir scripts_dir; do
while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_subdir output_name platform_config template_root data_dir scripts_dir; do
[ -n "$source_id" ] || continue
git archive --format=tar "origin/${THIRDPARTY_BRANCH}" "$snapshot_dir" | tar -xf - -C "$tmp_dir"
@@ -179,9 +161,6 @@ while IFS=$'\x1f' read -r source_id snapshot_dir sync_mode source_list skills_su
for dir in "$source_skills_dir"/*; do
[ -d "$dir" ] || continue
name="$(basename "$dir")"
if is_excluded_skill_dir "$name" "$exclude_skill_dirs"; then
continue
fi
if [ -n "${owners[$name]:-}" ] && [ "${owners[$name]}" != "$source_id" ]; then
echo "ERROR: duplicate third-party skill name: $name" >&2
exit 1