only show cleanup actions that will apply

This commit is contained in:
2025-08-12 09:46:40 +01:00
parent 50dc0c9f93
commit 45458b78c1

View File

@@ -14,10 +14,12 @@ SRC_DIRS=(
printf "This will back up and clean your Neovim directories.\n" printf "This will back up and clean your Neovim directories.\n"
printf "Backup suffix to be appended: %s\n\n" "$TAG" printf "Backup suffix to be appended: %s\n\n" "$TAG"
printf "Planned moves (only if source exists):\n" printf "Plan:\n"
for SRC in "${SRC_DIRS[@]}"; do for SRC in "${SRC_DIRS[@]}"; do
DEST="${SRC}${TAG}" if [ -e "$SRC" ]; then
printf " %s -> %s\n" "$SRC" "$DEST" DEST="${SRC}${TAG}"
printf " %s -> %s\n" "$SRC" "$DEST"
fi
done done
printf "\n" printf "\n"
@@ -33,8 +35,6 @@ for SRC in "${SRC_DIRS[@]}"; do
DEST="${SRC}${TAG}" DEST="${SRC}${TAG}"
printf "Moving %s -> %s\n" "$SRC" "$DEST" printf "Moving %s -> %s\n" "$SRC" "$DEST"
mv "$SRC" "$DEST" mv "$SRC" "$DEST"
else
printf "Skipping missing: %s\n" "$SRC"
fi fi
done done