core: Fix bug where if outputting empty string, would output nothing

This commit is contained in:
Mitchell Hashimoto 2014-04-27 18:19:44 -07:00
parent abf7c0526b
commit 68fe0b4258
1 changed files with 6 additions and 1 deletions

View File

@ -296,8 +296,13 @@ module Vagrant
target = @prefix
target = opts[:target] if opts.has_key?(:target)
# Get the lines. The first default is because if the message
# is an empty string, then we want to still use the empty string.
lines = [message]
lines = message.split("\n") if message != ""
# Otherwise, make sure to prefix every line properly
message.split("\n").map do |line|
lines.map do |line|
"#{prefix}#{target}: #{line}"
end.join("\n")
end