diff options
author | elijah <elijah@riseup.net> | 2012-10-21 13:59:57 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-10-21 13:59:57 -0700 |
commit | 338b3d97b8cb0f5fca0339514ffdfaf30cc65498 (patch) | |
tree | 32aa3dc7a6d3d9755983e8f343b836aaffa1defb /lib/leap_cli/commands/project.rb | |
parent | f63f2c63bd28fd3836d1e0edefe96b1fa76172f2 (diff) |
replace command 'init' with 'new-provider'
Diffstat (limited to 'lib/leap_cli/commands/project.rb')
-rw-r--r-- | lib/leap_cli/commands/project.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/leap_cli/commands/project.rb b/lib/leap_cli/commands/project.rb new file mode 100644 index 0000000..8ec9625 --- /dev/null +++ b/lib/leap_cli/commands/project.rb @@ -0,0 +1,25 @@ +module LeapCli + module Commands + + desc 'Creates a new provider directory.' + arg_name '<directory>' + skips_pre + command :'new-provider' do |c| + c.action do |global_options,options,args| + directory = args.first + unless directory && directory.any? + help! "Directory name is required." + end + directory = File.expand_path(directory) + if File.exists?(directory) + raise "#{directory} already exists." + end + if agree("Create directory '#{directory}'? ") + LeapCli.init(directory) + else + puts "OK, bye." + end + end + end + end +end
\ No newline at end of file |