diff --git a/scripts/normalize-spaces.sh b/scripts/normalize-spaces.sh index e1b3019de..9eddda413 100755 --- a/scripts/normalize-spaces.sh +++ b/scripts/normalize-spaces.sh @@ -7,10 +7,13 @@ set -euo pipefail ROOT_DIR="${1:-}" if [ -z "$ROOT_DIR" ]; then - echo "Usage: $0 " - exit 1 + echo "Usage: $0 " + exit 1 fi find "$ROOT_DIR" -type f -name '*' -print0 | while IFS= read -r -d '' file; do - mv -v "$file" "$(echo "$file" | tr ' ' '+')" + new_file="$(echo "$file" | tr ' ' '+')" + if [[ "$file" != "$new_file" ]]; then + mv -v "$file" "$new_file" + fi done