Respect --prune also if --config-name is missing

This commit is contained in:
Martin Puppe 2020-03-25 20:47:48 +01:00
parent 8831c2b403
commit 9fe11e852e

View file

@ -137,7 +137,11 @@ config_names = options[:config_names]
if config_names.empty? if config_names.empty?
puts "No configuration name has been given. Will use the first "\ puts "No configuration name has been given. Will use the first "\
"configuration from the file (#{configs.dig(0, 'name')})." "configuration from the file (#{configs.dig(0, 'name')})."
backup configs[0] if options[:prune]
prune configs[0]
else
backup configs[0]
end
else else
config_hash = configs.map {|c| [c['name'], c]}.to_h config_hash = configs.map {|c| [c['name'], c]}.to_h
config_names.each do |name| config_names.each do |name|