Last active
January 9, 2020 22:03
-
-
Save bdurand/00ed9e833c800fd3ce3f5a131b32abd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Strip trailing whitespace from modified code files in git. | |
set -o errexit | |
# set -o xtrace | |
git diff --cached --name-only --diff-filter=ACM | egrep -e '\.(rb|js|css|scss|erb|html)$' | xargs sed -i '' -E 's/[[:space:]]+$//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment