class Chef::Knife::Download

Constants

ChefFS

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/download_essentials.rb, line 49
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

  error = false
  pattern_args.each do |pattern|
    if ChefFS::FileSystem.copy_to(pattern, chef_fs, local_fs, config[:recurse] ? nil : 1, config, ui, proc { |entry| format_path(entry) })
      error = true
    end
  end
  if error
    exit 1
  end
end