Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The basic CLI tool doesn't have a way to actually change the file #68

Open
olleicua opened this issue Jul 1, 2016 · 0 comments
Open

Comments

@olleicua
Copy link

olleicua commented Jul 1, 2016

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant