Merge pull request #10405 from briancain/fixup-inline-windows-trigger-run
Fixes #10393: Only use Shellwords on non-windows hosts
This commit is contained in:
commit
608863809a
|
@ -161,7 +161,11 @@ module Vagrant
|
||||||
# @param [Provisioners::Shell::Config] config A Shell provisioner config
|
# @param [Provisioners::Shell::Config] config A Shell provisioner config
|
||||||
def run(config, on_error, exit_codes)
|
def run(config, on_error, exit_codes)
|
||||||
if config.inline
|
if config.inline
|
||||||
cmd = Shellwords.split(config.inline)
|
if Vagrant::Util::Platform.windows?
|
||||||
|
cmd = config.inline
|
||||||
|
else
|
||||||
|
cmd = Shellwords.split(config.inline)
|
||||||
|
end
|
||||||
|
|
||||||
@machine.ui.detail(I18n.t("vagrant.trigger.run.inline", command: config.inline))
|
@machine.ui.detail(I18n.t("vagrant.trigger.run.inline", command: config.inline))
|
||||||
else
|
else
|
||||||
|
|
|
@ -181,7 +181,7 @@ describe Vagrant::Plugin::V2::Trigger do
|
||||||
exit_codes = trigger.exit_codes
|
exit_codes = trigger.exit_codes
|
||||||
|
|
||||||
expect(Vagrant::Util::PowerShell).to receive(:execute_inline).
|
expect(Vagrant::Util::PowerShell).to receive(:execute_inline).
|
||||||
with("echo", "hi", options)
|
with("echo 'hi'", options)
|
||||||
subject.send(:run, shell_config, on_error, exit_codes)
|
subject.send(:run, shell_config, on_error, exit_codes)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue