Skip to content

Instantly share code, notes, and snippets.

@altamic
Created March 14, 2009 18:42
Show Gist options
  • Save altamic/79142 to your computer and use it in GitHub Desktop.
Save altamic/79142 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 -e ${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