Class: ClusterFuck::Commands::Override

Inherits:
Object
  • Object
show all
Includes:
AmicusEnvArgumentParser
Defined in:
lib/cluster-fuck/commands/override.rb

Instance Method Summary collapse

Methods included from AmicusEnvArgumentParser

included, #set_amicus_env_and_key_from_args

Instance Method Details

#run_command(args, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/cluster-fuck/commands/override.rb', line 9

def run_command(args, options = {})
  set_amicus_env_and_key_from_args(args)

  contents = reader.read(remote_only: true)
  FileUtils.mkdir_p(File.dirname(reader.local_override_path))
  File.open(reader.local_override_path, "w") do |f|
    f << contents.to_yaml
  end
  $stdout.puts("wrote #{reader.local_override_path} with contents of #{reader.full_s3_path(key)}")
end