DannyBen/rigit

View on GitHub
bin/rig

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby
require 'rigit'
require 'colsole'
include Colsole

begin
  Rigit::CommandLine.execute ARGV
rescue Rigit::Exit => e
  message = e.message
  say message unless message == 'Rigit::Exit'
  exit 1
rescue Rigit::ConfigError => e
  say "r`#{e.class} - #{e.message}`"
  exit 1
rescue Rigit::TemplateError => e
  say "r`#{e.class} - #{e.message}`\nin g`#{e.file}`"
  say 'Are you escaping % characters as %%?' if e.message.include?('%')
rescue TTY::Reader::InputInterrupt
  say "\nGoodbye"
  exit 1
end