Forked from carlthuringer/Convert recursively all erb files in a directory to haml
Created
January 6, 2014 13:32
-
-
Save nicholasklick/8282931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment