Skip to content

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

Open
@olleicua

Description

@olleicua

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions