Sha256: 3835db698e08eb90e5bb17c72c42ba9b3b0cca69776e90412579bf01e3a81a22

Contents?: true

Size: 1.4 KB

Versions: 16

Compression:

Stored size: 1.4 KB

Contents

require 'chef/chef_fs/knife'
require 'chef/chef_fs/command_line'

class Chef
  class Knife
    class Download < Chef::ChefFS::Knife
      banner "knife download 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
        if name_args.length == 0
          show_usage
          ui.fatal("Must specify at least one argument.  If you want to download everything in this directory, type \"knife download .\"")
          exit 1
        end

        pattern_args.each do |pattern|
          Chef::ChefFS::FileSystem.copy_to(pattern, chef_fs, local_fs, config[:recurse] ? nil : 1, config)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
chef-11.4.4 lib/chef/knife/download.rb
chef-11.4.2 lib/chef/knife/download.rb
microwave-11.400.8 lib/chef/knife/download.rb
microwave-11.400.7 lib/chef/knife/download.rb
microwave-11.400.6 lib/chef/knife/download.rb
microwave-11.400.5 lib/chef/knife/download.rb
microwave-11.400.4 lib/chef/knife/download.rb
chef-11.4.0 lib/chef/knife/download.rb
chef-11.4.0.rc.0 lib/chef/knife/download.rb
chef-11.0.0.beta.2 lib/chef/knife/download.rb
chef-11.2.0 lib/chef/knife/download.rb
chef-11.2.0.rc.1 lib/chef/knife/download.rb
chef-11.0.0 lib/chef/knife/download.rb
chef-11.0.0.rc.0 lib/chef/knife/download.rb
chef-11.0.0.beta.1 lib/chef/knife/download.rb
chef-11.0.0.beta.0 lib/chef/knife/download.rb