diff options
author | statik <elliot@elliotmurphy.com> | 2010-12-23 14:42:17 -0700 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2011-05-20 11:56:19 -0700 |
commit | 04dca9147214ffb2882183f8af6e1b371cb31895 (patch) | |
tree | ae9ef3f6f5b4b50be8f4b526986ca3f649321c54 | |
parent | 72277f901979a57d9a78090450a68d0a71e9e7c0 (diff) | |
download | chef-04dca9147214ffb2882183f8af6e1b371cb31895.tar.gz |
CHEF-1588: Add a -d option to include dependencies when uploading.
No tests!
-rw-r--r-- | chef/lib/chef/knife/cookbook_upload.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chef/lib/chef/knife/cookbook_upload.rb b/chef/lib/chef/knife/cookbook_upload.rb index 011fc3e6c6..6bc229a675 100644 --- a/chef/lib/chef/knife/cookbook_upload.rb +++ b/chef/lib/chef/knife/cookbook_upload.rb @@ -60,6 +60,11 @@ class Chef :long => '--environment ENVIRONMENT', :description => "Set ENVIRONMENT's version dependency match the version you're uploading.", :default => nil + + option :depends, + :short => "-d", + :long => "--include-dependencies", + :description => "Upload dependencies also" def run config[:cookbook_path] ||= Chef::Config[:cookbook_path] @@ -85,6 +90,11 @@ class Chef @name_args.each do |cookbook_name| begin cookbook = cookbook_repo[cookbook_name] + if config[:depends] + cookbook.metadata.dependencies.each do |dep, versions| + @name_args.push dep + end + end cookbook.freeze_version if config[:freeze] upload(cookbook, justify_width) version_constraints_to_update[cookbook_name] = cookbook.version |