14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/karo/config.rb', line 14
def self.load_configuration(options)
begin
config_file = File.expand_path(options[:config_file])
configuration = read_configuration(config_file)[options[:environment]]
if configuration.nil? || configuration.empty?
raise Thor::Error, "Please pass a valid configuration for an environment '#{options[:environment]}' within this file '#{config_file}'"
else
configuration
end
rescue Karo::NoConfigFileFoundError
puts "You can use 'karo generate' to generate a skeleton .karo.yml file"
puts "Please make sure that this configuration file exists? '#{config_file}'"
raise Thor::Error, "and run the command again"
end
end
|