lib/cloudstack-cli/commands/environment.rb in cloudstack-cli-0.6.0 vs lib/cloudstack-cli/commands/environment.rb in cloudstack-cli-0.6.1
- old
+ new
@@ -40,16 +40,18 @@
config = {env => config}
config[:default] = env if options[:default]
end
if File.exists? options[:config_file]
- newfile = true
old_config = parse_config_file
if !env || old_config.has_key?(env)
say "This environment already exists!", :red
exit unless yes?("Do you want to override your settings? [y/N]", :yellow)
end
config = old_config.merge(config)
+ else
+ newfile = true
+ config[:default] = env if env
end
write_config_file(config)
if newfile
say "OK. Created configuration file at #{options[:config_file]}.", :green
\ No newline at end of file