Skip to content

Instantly share code, notes, and snippets.

@swards
Last active August 29, 2015 14:03
Show Gist options
  • Save swards/4f69606a4bf88767b79c to your computer and use it in GitHub Desktop.
Save swards/4f69606a4bf88767b79c to your computer and use it in GitHub Desktop.
A script to go through all erb files and convert them to haml
// Run without 'bash' to see the commands called. To be run from the root of the application folder (above the app directory)
$ find app -name '*.erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \
bash
// And a script to remove all erb files via git (remove 'git' if not in git yet)
$ find app -name '*.erb' | \
xargs ruby -e 'ARGV.each { |i| puts "git rm #{i}"}' | \
bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment