Last active
November 9, 2015 19:07
-
-
Save schlueter/5c350d8f23589f3f4d1e to your computer and use it in GitHub Desktop.
Source cleanup on OS X
This file contains hidden or 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
# Remove trailing whitespace | |
find . -not \( -name .git -prune \) -type f -print0 | LC_ALL=C xargs -0 sed -i '' -E "s/[[:blank:]]+$//" | |
# Add newline @ eof if missing | |
find . -type f -print0 | LC_ALL=C xargs -0 sed -i -e '$a\' file | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment