Handle interrupts more gracefully on the warning message
This commit is contained in:
parent
690d380b77
commit
c634cbedcc
12
bin/vagrant
12
bin/vagrant
|
@ -43,8 +43,16 @@ begin
|
|||
"\n" +
|
||||
"This message will be removed when this version is officially released.",
|
||||
:prefix => false)
|
||||
result = env.ui.ask("If you're sure you'd like to continue, type 'Y' and then enter: ")
|
||||
exit 0 if result && result.upcase != "Y"
|
||||
result = nil
|
||||
begin
|
||||
result = env.ui.ask("If you're sure you'd like to continue, type 'Y' and then enter: ")
|
||||
rescue Interrupt
|
||||
result = nil
|
||||
rescue Vagrant::Errors::UIExpectsTTY
|
||||
result = nil
|
||||
end
|
||||
|
||||
exit 0 if !result || result.upcase != "Y"
|
||||
|
||||
# Load the environment
|
||||
logger.debug("Loading environment")
|
||||
|
|
|
@ -29,6 +29,7 @@ module VagrantPlugins
|
|||
do_destroy = true
|
||||
else
|
||||
choice = nil
|
||||
|
||||
begin
|
||||
choice = @env.ui.ask(I18n.t("vagrant.commands.destroy.confirmation",
|
||||
:name => vm.name))
|
||||
|
@ -41,6 +42,7 @@ module VagrantPlugins
|
|||
# means the same thing.
|
||||
raise Vagrant::Errors::DestroyRequiresForce
|
||||
end
|
||||
|
||||
do_destroy = choice.upcase == "Y"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue