Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # replace all erb files in directory with haml files
- # use with caution
- # todo: needs to fix indentation inside blocks
- function erb2haml {
- find `pwd` -name "*erb" | while read file; do
- local output=`echo $file | sed 's/erb$/haml/'`
- echo "converting $file to `basename $output`"
- html2haml $file | sed '/- end/d' > $output
- # rm $file #uncomment this line if you want to remove the erb file after conversion
- done
- }
Add Comment
Please, Sign In to add comment