lib/chef/knife/cookbook_cleanup.rb in knife-cookbook-cleanup-0.1.1pre vs lib/chef/knife/cookbook_cleanup.rb in knife-cookbook-cleanup-0.1.1
- old
+ new
@@ -57,15 +57,17 @@
ui.msg ""
ui.msg "The following cookbook versions will be deleted:"
ui.msg ""
ui.msg ui.output(drop_cookbooks)
ui.msg ""
- ui.confirm("Do you really want to delete these cookbooks? (Y/N) ", false)
+ unless config[:yes]
+ ui.confirm("Do you really want to delete these cookbooks? (Y/N) ", false)
+ end
drop_cookbooks.each do |cookbook, versions|
versions.each do |version|
rest.delete_rest("cookbooks/#{cookbook}/#{version}")
- ui.info("Deleted cookbook #{cookbook.ljust(25)} [#{version}]")
+ ui.info("Deleted cookbook #{cookbook.ljust(25)} [#{version}]")
end
end
end
end
end