diff --git a/scripts/trailing-whitespace.sh b/scripts/trailing-whitespace.sh index 5a9e7d0..01c96ac 100755 --- a/scripts/trailing-whitespace.sh +++ b/scripts/trailing-whitespace.sh @@ -6,7 +6,7 @@ function remove-whitespace { exclude_paths=( ".git" ) - exclude_files=( + exclude_extensions=( "*.lst" "*.map" "*.svd" @@ -97,16 +97,16 @@ function remove-whitespace { fi done - excludes+=(")" "-type d" "-prune" "-o") + excludes+=(")" "-type" "d" "-prune" "-o") - for arg in "${exclude_files[@]}"; do + for arg in "${exclude_extensions[@]}"; do excludes+=("-not" "-name" "${arg}") done for arg in "${path_args[@]}"; do files=("$( find "${arg}" \ - ${excludes[@]} \ + "${excludes[@]}" \ -type f \ -exec grep -EIq "${grep_regex}" {} \; \ -print