Merge pull request #8725 from chrisroberts/fix/windows-shellout

Rebuild command and arguments before exec on Windows
This commit is contained in:
Chris Roberts 2017-06-27 19:39:21 -07:00 committed by GitHub
commit a2ce948f91
1 changed files with 6 additions and 6 deletions

View File

@ -41,14 +41,14 @@ module Vagrant
end end
else else
if Vagrant::Util::Platform.windows? if Vagrant::Util::Platform.windows?
@@logger.debug("Converting command and arguments to single string for exec") # Re-generate strings to ensure common encoding
@@logger.debug("Converting command and arguments to common UTF-8 encoding for exec.")
@@logger.debug("Command: `#{command.inspect}` Args: `#{args.inspect}`") @@logger.debug("Command: `#{command.inspect}` Args: `#{args.inspect}`")
full_command = "#{command} #{args.join(" ")}" command = "#{command}".force_encoding("UTF-8")
@@logger.debug("Converted command: #{full_command}") args = args.map{|arg| "#{arg}".force_encoding("UTF-8") }
Kernel.exec(full_command) @@logger.debug("Converted - Command: `#{command.inspect}` Args: `#{args.inspect}`")
else
Kernel.exec(command, *args)
end end
Kernel.exec(command, *args)
end end
rescue *rescue_from rescue *rescue_from
# We retried already, raise the issue and be done # We retried already, raise the issue and be done