Class: Ey::Core::Cli::Recipes::Download

Inherits:
Subcommand
  • Object
show all
Includes:
Helpers::Archive
Defined in:
lib/ey-core/cli/recipes/download.rb

Instance Method Summary collapse

Methods included from Helpers::Archive

#archive_directory, #gzip, #ungzip, #untar

Methods inherited from Subcommand

#handle_core_error, #run_handle, #setup

Methods included from Helpers::Core

#core_account, #core_accounts, #core_application_for, #core_applications, #core_client, #core_environment_for, #core_environment_variables, #core_environments, #core_operator_and_environment_for, #core_server_for, #core_url, #core_yaml, #eyrc_yaml, included, #longest_length_by_name, #operator, #unauthenticated_core_client, #write_core_yaml

Instance Method Details

#handleObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/ey-core/cli/recipes/download.rb', line 33

def handle
  if File.exist?("cookbooks")
    raise Ey::Core::Cli::RecipesExist.new(
      "Cannot download recipes, cookbooks directory already exists."
    )
  end

  operator, environment = core_operator_and_environment_for(options)
  
  puts "Downloading recipes".green
  recipes = environment.download_recipes

  puts "Extracting recipes to 'cookbooks/'".green
  untar(ungzip(recipes), './')
end