only show cleanup actions that will apply
This commit is contained in:
6
clean.sh
6
clean.sh
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user