Open olleicua opened 8 years ago
I made one for myself but it seems like maybe there should be a flag for it.
$ cat ~/bin/ham
#!/usr/bin/env ruby if ARGV.size != 1 or !(ARGV[0] =~ /.html.erb$/) puts "Usage: ham FILE.html.erb" exit else old = ARGV[0] new = old.sub /\.html\.erb$/, ".html.haml" puts "#{old} -> #{new}" command = "html2haml #{old} > #{new} && rm -v #{old}" exec command end
$ ham path/to/template.html.erb path/to/template.html.erb -> path/to/template.html.haml removed 'path/to/template.html.erb'
I made one for myself but it seems like maybe there should be a flag for it.