lib/docman/cli.rb in docman-0.0.16 vs lib/docman/cli.rb in docman-0.0.17

- old
+ new

@@ -34,11 +34,11 @@ puts "Init docroot directory #{name} and retrieve config from provided repo." Application.instance.init(name, repo) say('Complete!', :green) end - desc 'build NAME', 'init to NAME' + desc 'build', 'Build docroot' method_option :force, :aliases => '-f', :desc => 'Force full rebuild' option :tag def build(deploy_target, state) config_dir? if options[:force] @@ -46,11 +46,11 @@ end Application.instance.build(deploy_target, state, options) say('Complete!', :green) end - desc 'deploy NAME', 'init to NAME' + desc 'deploy', 'Deploy to target' method_option :force, :aliases => '-f', :desc => 'Force full deploy' def deploy(deploy_target, name, type, version) if version.start_with?('state_') state = version.partition('_').last build(deploy_target, state) @@ -59,22 +59,12 @@ Application.instance.deploy(deploy_target, name, type, version, options) say('Complete!', :green) end end - desc 'state NAME', 'init to NAME' - def state(name, type, version) - config_dir? - Application.instance.state(name, type, version) - say('Complete!', :green) - end - no_commands { def config_dir? - unless File.directory?('config') - $stderr.puts 'ERROR: No config directory in docroot' - exit 1 - end + raise 'ERROR: No config directory in docroot' unless File.directory?('config') end } end end \ No newline at end of file