Join command with given arguments before running exec
This resolves issues where directly passing arguments individually to Kernel.exec causes encoding errors due to arguments being forced command/shell encoding which is not always correct.
This commit is contained in:
parent
c555e4b72f
commit
154c3be0d4
|
@ -40,7 +40,15 @@ module Vagrant
|
||||||
Process.wait(pid)
|
Process.wait(pid)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Kernel.exec(command, *args)
|
if Vagrant::Util::Platform.windows?
|
||||||
|
@@logger.debug("Converting command and arguments to single string for exec")
|
||||||
|
@@logger.debug("Command: `#{command.inspect}` Args: `#{args.inspect}`")
|
||||||
|
full_command = "#{command} #{args.join(" ")}"
|
||||||
|
@@logger.debug("Converted command: #{full_command}")
|
||||||
|
Kernel.exec(full_command)
|
||||||
|
else
|
||||||
|
Kernel.exec(command, *args)
|
||||||
|
end
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue