Created
October 21, 2011 08:02
-
-
Save eric-hu/1303331 to your computer and use it in GitHub Desktop.
short shell script for converting jst.ejs files to jst.ejs.haml files for haml_assets
This file contains hidden or 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 | |
# Converts jst.ejs files into jst.ejs.haml files | |
# Adapted from: http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet | |
# | |
# Run this script from the root of your Rails project directory (or other language of your choice) | |
# | |
# It will output one line for each file it'll convert. Look the list over and verify that everything | |
# looks right. Once you're certain (I suggest doing a backup/git commit at this point), run: | |
# | |
# jst2haml | bash | |
# | |
# To remove old jst.ejs files, use | |
# | |
# find -iname *.jst.ejs | |
# | |
# Once again, look this over as a sanity check, then run: | |
# | |
# find -iname *.jst.ejs -delete | |
find . -name '*jst.ejs' | \ | |
xargs ruby -e 'ARGV.each { |i| puts "html2haml --no-erb #{i} #{i.sub(/ejs$/,"ejs.haml")}"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment