Skip to content

Instantly share code, notes, and snippets.

@bhaberer
Forked from altamic/gist:79142
Created June 15, 2010 09:48
Show Gist options
  • Save bhaberer/438918 to your computer and use it in GitHub Desktop.
Save bhaberer/438918 to your computer and use it in GitHub Desktop.
#! /bin/bash
# erb2haml
# by Michelangelo Altamore
# Obtains a file list having an html.erb extension
# under the current dir and convert each file
# to haml format with html.haml extension.
# It requires haml gem.
for erb_file in `find . -name *.html.erb`; do
if [ -f $erb_file ] ; then
name=${erb_file%\.html.erb};
html2haml ${erb_file} > ${name}.html.haml;
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment