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