Skip to content

Instantly share code, notes, and snippets.

@kanmeiban
Created October 31, 2016 14:18
Show Gist options
  • Save kanmeiban/59802357f8e916d836f90ac8548bbfd3 to your computer and use it in GitHub Desktop.
Save kanmeiban/59802357f8e916d836f90ac8548bbfd3 to your computer and use it in GitHub Desktop.
#!/bin/sh
# |skip entire .git | | skip binary files | remove trailing whitespace
find . -not \( -name .git -prune \) -type f -print0 | xargs -0 file -In | grep -v binary | cut -d ":" -f1 | xargs ruby -pi -e 'gsub(/ +$/, "")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment