Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
bash script to html2haml for multiple files
# 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