diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2014-09-12 13:28:53 +0900 |
---|---|---|
committer | sawanoboly <sawanoboriyu@higanworks.com> | 2014-09-12 13:28:53 +0900 |
commit | 3ecb3389fc558880e63f53ca829abff96e69ac1a (patch) | |
tree | 91bb9df88463a8f5fae938de85523a84a84e1e49 /lib/chef/knife | |
parent | 1ab9ae58068da346bf2262cb0b8acc14a72d9f2b (diff) | |
download | chef-3ecb3389fc558880e63f53ca829abff96e69ac1a.tar.gz |
change option name to dry-run and set false as default.
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index e5c56f654d..189c9c8db0 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -40,11 +40,12 @@ class Chef :description => "A colon-separated path to look for cookbooks in", :proc => lambda { |o| Chef::Config.cookbook_path = o.split(":") } - option :upload, - :long => "--[no-]upload", - :description => "Upload cookbook to SuperMacket, defaults is true. If given --no-upload, only show list of archived files", + option :dry_run, + :long => '--dry-run', + :short => '-n', :boolean => true, - :default => true + :default => false, + :description => "Don't take action, only print what files will be upload to SuperMarket." def run if @name_args.length < 2 @@ -72,10 +73,11 @@ class Chef exit(1) end - unless config[:upload] - ui.info("Not uploading #{cookbook_name}.tgz due to --no-upload flag.") + if config[:dry_run] + ui.info("Not uploading #{cookbook_name}.tgz due to --dry-run flag.") result = shell_out!("tar -tzf #{cookbook_name}.tgz", :cwd => tmp_cookbook_dir) ui.info(result.stdout) + puts `find #{tmp_cookbook_dir}` FileUtils.rm_rf tmp_cookbook_dir return end |