Created
February 5, 2010 01:14
-
-
Save codesnik/295361 to your computer and use it in GitHub Desktop.
convert before commit
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
#!/usr/bin/env zsh | |
# convert to utf8, | |
# remove unneccessary utf8 BOM | |
# add new line at end of file if omitted | |
# change line terminators to cr from crlf | |
for f in public/**/*.{css,js,html,htm}; do | |
mv $f $f.orig | |
cat $f.orig | \ | |
enconv -x utf8 | \ | |
perl -CSDA -lpe 'tr/\x{feff}\r//d' > $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment