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 "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
if [ -e "$SRC" ]; then
DEST="${SRC}${TAG}"
printf " %s -> %s\n" "$SRC" "$DEST"
fi
done
printf "\n"
@@ -33,8 +35,6 @@ for SRC in "${SRC_DIRS[@]}"; do
DEST="${SRC}${TAG}"
printf "Moving %s -> %s\n" "$SRC" "$DEST"
mv "$SRC" "$DEST"
else
printf "Skipping missing: %s\n" "$SRC"
fi
done