Created
September 17, 2012 16:27
-
-
Save soulcutter/3738320 to your computer and use it in GitHub Desktop.
Adding magic encoding comments to ruby files
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
#!/bin/zsh | |
for file in $(awk 'FNR == 1 && !/^#\!/ { print FILENAME; nextfile }' **/*.rb); do | |
echo $file | |
sed -i 1i'# encoding: utf-8' $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment