Created
October 13, 2011 09:50
-
-
Save suzukimilanpaak/1283870 to your computer and use it in GitHub Desktop.
bash script to html2haml for multiple files
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
# Usage; | |
# htmls2hamls RAILS_ROOT/app/views/TARGETS | |
# Assume $1 is path to directory containing views in a rails project and $2 | |
: $1 | |
if test -d $1 | |
then echo 'processing..' | |
else echo Directory path must be specified for first argument; exit | |
fi | |
for i in $1/*.html.erb | |
do html2haml $i > ${i%.erb}.haml | |
done | |
rm $1/*.html.erb | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment