Add manual catalog management

This commit is contained in:
2026-04-14 18:24:49 +08:00
parent 0c01b91fd7
commit 89bdf2ff61
7 changed files with 1062 additions and 15 deletions
+20
View File
@@ -29,6 +29,24 @@ sync_missing_dir_entries() {
done
}
migrate_legacy_manual_catalog() {
legacy_dir="$DATA_ROOT/workspace/brands/local"
target_dir="$DATA_ROOT/workspace/local"
legacy_file="$legacy_dir/manual_catalog.json"
target_file="$target_dir/manual_catalog.json"
[ -d "$legacy_dir" ] || return
mkdir -p "$target_dir"
if [ -f "$legacy_file" ] && [ ! -f "$target_file" ]; then
cp -a "$legacy_file" "$target_file"
fi
# Older builds accidentally copied local overlay files under brands/local.
# Once the real target exists, drop the misplaced directory to avoid confusion.
rm -rf "$legacy_dir"
}
init_path() {
rel_path="$1"
src_path="$APP_ROOT/$rel_path"
@@ -82,3 +100,5 @@ for rel_path in \
do
init_path "$rel_path"
done
migrate_legacy_manual_catalog