Skip to content

Instantly share code, notes, and snippets.

@kleinjm
Created October 24, 2016 13:23
Show Gist options
  • Save kleinjm/1ff48b77a228e21ba9d58045d061712b to your computer and use it in GitHub Desktop.
Save kleinjm/1ff48b77a228e21ba9d58045d061712b to your computer and use it in GitHub Desktop.
Converts all files in a project directory to .html.haml from .html.erb
#!/bin/bash
gem install html2haml
find . -name \*.erb -print | sed 'p;s/.erb$/.haml/' | xargs -n2 html2haml
find . -type f -name '*.html.erb' -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment