Permalink
Browse files

Added html2haml script for batch processing erb files.

  • Loading branch information...
1 parent 06cd9d6 commit 3448168618cbdd477847b38a471556c8c8a13b1c @fredwu committed May 31, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 script/html2haml
View
@@ -0,0 +1,18 @@
+#!/bin/bash
+if [ -z "$1" ]; then
+ wdir="."
+else
+ wdir=$1
+fi
+
+for f in $( find . -name '*.erb' ); do
+ out="${f%.erb}.haml"
+ if [ -e $out ]; then
+ echo "skipping $out; already exists"
+ rm $f
+ else
+ echo "hamlifying $f"
+ html2haml $f > $out
+ rm $f
+ fi
+done

0 comments on commit 3448168

Please sign in to comment.