Skip to content

Instantly share code, notes, and snippets.

@suzukimilanpaak
Created October 13, 2011 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suzukimilanpaak/1283870 to your computer and use it in GitHub Desktop.
Save suzukimilanpaak/1283870 to your computer and use it in GitHub Desktop.
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