Script cleanup

This commit is contained in:
David Tomaschik
2026-07-06 15:59:12 -07:00
parent 22b3f2e049
commit da1ee162c2
13 changed files with 225 additions and 111 deletions

View File

@@ -47,7 +47,7 @@ shift $((OPTIND - 1)) # Remove the parsed options
# --- Set target directory ---
# Use the first remaining argument as the target directory.
if [ -n "$1" ]; then
if [ "$#" -gt 0 ]; then
TARGET_DIR="$1"
fi
@@ -75,7 +75,7 @@ find "${TARGET_DIR}" -type l ! -exec test -e {} \; -print0 | while IFS= read -r
continue
fi
# Ask the user for confirmation.
read -p "Remove broken symlink '${link}'? [y/N] " -n 1 -r
read -p "Remove broken symlink '${link}'? [y/N] " -n 1 -r < /dev/tty
echo # Move to a new line after input.
if [[ $REPLY =~ ^[Yy]$ ]]; then