Guest User

Untitled

a guest
May 20th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # replace all erb files in directory with haml files
  2. # use with caution
  3. # todo: needs to fix indentation inside blocks
  4. function erb2haml {
  5. find `pwd` -name "*erb" | while read file; do
  6. local output=`echo $file | sed 's/erb$/haml/'`
  7. echo "converting $file to `basename $output`"
  8. html2haml $file | sed '/- end/d' > $output
  9. # rm $file #uncomment this line if you want to remove the erb file after conversion
  10. done
  11. }
Add Comment
Please, Sign In to add comment