Handle the case where ctrl-D is pressed on input.
This commit is contained in:
parent
e92fbb4d33
commit
a34801588c
|
@ -73,8 +73,11 @@ module Vagrant
|
||||||
# Output the data
|
# Output the data
|
||||||
say(:info, message, opts)
|
say(:info, message, opts)
|
||||||
|
|
||||||
# Get the results and chomp off the newline
|
# Get the results and chomp off the newline. We do a logical OR
|
||||||
$stdin.gets.chomp
|
# here because `gets` can return a nil, for example in the case
|
||||||
|
# that ctrl-D is pressed on the input.
|
||||||
|
input = $stdin.gets || ""
|
||||||
|
input.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is used to output progress reports to the UI.
|
# This is used to output progress reports to the UI.
|
||||||
|
|
Loading…
Reference in New Issue