# encoding: utf-8 require 'fileutils' require 'thor' module Napkin class CLI < Thor include Thor::Actions def self.source_root File.join(File.dirname(__FILE__), 'files') end desc 'setup TOOL', 'set up TOOL' method_option :bootstrap_file, :aliases => '-b', :desc => 'Bootstrap template for veronic/chef' def setup(tool) puts "Setting up #{tool}!" case tool when 'veronic' bootstrap_file = options[:bootstrap_file] || '/etc/veronic/bootstrap/lifted-chef.erb' FileUtils.mkdir_p(File.dirname(bootstrap_file)) copy_file(File.basename(bootstrap_file), bootstrap_file) else puts "#{tool} is not a recognized tool!" exit 1 end end end end