Created
January 27, 2011 16:17
-
-
Save unicornrainbow/798713 to your computer and use it in GitHub Desktop.
A shell function to auto remove whitespace from an entire rails project in one shot.
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
remove_project_trailing_whitespace () { | |
for file in * (app|config|test|lib|public)/**/*.(rb|js|sass|css|yml|md|txt|erb|haml|config) | |
do | |
sed -i "" 's/[[:space:]]*$//' ${file} | |
sed -i "" -e :a -e '/^\n*$/N;/\n$/ba' ${file} | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment