fix: use rsync in sync-upstream to avoid circular symlinks in node_modules
This commit is contained in:
parent
0ec276d421
commit
91824bc53c
@ -67,7 +67,10 @@ backup_local() {
|
|||||||
if [[ -d "$REPO_DIR/$ext" ]]; then
|
if [[ -d "$REPO_DIR/$ext" ]]; then
|
||||||
local dest="$BACKUP_DIR/$ext"
|
local dest="$BACKUP_DIR/$ext"
|
||||||
mkdir -p "$(dirname "$dest")"
|
mkdir -p "$(dirname "$dest")"
|
||||||
cp -r "$REPO_DIR/$ext" "$dest"
|
# Use rsync to exclude node_modules and avoid circular symlinks
|
||||||
|
rsync -a --exclude='node_modules' "$REPO_DIR/$ext/" "$dest/" 2>/dev/null || {
|
||||||
|
warn " Backup of $ext had warnings (likely circular symlinks)"
|
||||||
|
}
|
||||||
info " Backed up: $ext"
|
info " Backed up: $ext"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -91,7 +94,9 @@ restore_local() {
|
|||||||
if [[ -d "$src" ]]; then
|
if [[ -d "$src" ]]; then
|
||||||
# Remove upstream version if exists (unlikely for local-only)
|
# Remove upstream version if exists (unlikely for local-only)
|
||||||
rm -rf "$dest"
|
rm -rf "$dest"
|
||||||
cp -r "$src" "$dest"
|
mkdir -p "$dest"
|
||||||
|
# Use rsync for consistency with backup
|
||||||
|
rsync -a "$src/" "$dest/"
|
||||||
info " Restored: $ext"
|
info " Restored: $ext"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user