diff options
author | Seth Chisamore <schisamo@opscode.com> | 2012-10-30 10:39:35 -0400 |
---|---|---|
committer | Seth Chisamore <schisamo@opscode.com> | 2012-10-30 10:39:35 -0400 |
commit | 24dc69a9a97e82a6e4207de68d6dcc664178249b (patch) | |
tree | 19bb289c9f88b4bbab066bc56b95d6d222fd5c35 /lib/chef/knife/upload.rb | |
parent | 9348c1c9c80ee757354d624b7dc1b78ebc7605c4 (diff) | |
download | chef-24dc69a9a97e82a6e4207de68d6dcc664178249b.tar.gz |
[OC-3564] move core Chef to the repo root \o/ \m/
The opscode/chef repository now only contains the core Chef library code
used by chef-client, knife and chef-solo!
Diffstat (limited to 'lib/chef/knife/upload.rb')
-rw-r--r-- | lib/chef/knife/upload.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/chef/knife/upload.rb b/lib/chef/knife/upload.rb new file mode 100644 index 0000000000..ff8616543e --- /dev/null +++ b/lib/chef/knife/upload.rb @@ -0,0 +1,47 @@ +require 'chef/chef_fs/knife' +require 'chef/chef_fs/command_line' + +class Chef + class Knife + class Upload < Chef::ChefFS::Knife + banner "knife upload PATTERNS" + + common_options + + option :recurse, + :long => '--[no-]recurse', + :boolean => true, + :default => true, + :description => "List directories recursively." + + option :purge, + :long => '--[no-]purge', + :boolean => true, + :default => false, + :description => "Delete matching local files and directories that do not exist remotely." + + option :force, + :long => '--[no-]force', + :boolean => true, + :default => false, + :description => "Force upload of files even if they match (quicker and harmless, but doesn't print out what it changed)" + + option :dry_run, + :long => '--dry-run', + :short => '-n', + :boolean => true, + :default => false, + :description => "Don't take action, only print what would happen" + + def run + patterns = pattern_args_from(name_args.length > 0 ? name_args : [ "" ]) + + # Get the matches (recursively) + patterns.each do |pattern| + Chef::ChefFS::FileSystem.copy_to(pattern, local_fs, chef_fs, config[:recurse] ? nil : 1, config) + end + end + end + end +end + |