Use args setting for run option in trigger

This commit is contained in:
Brian Cain 2018-04-05 09:08:09 -07:00
parent 8451cbf854
commit 4e5e4d0214
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 9 additions and 1 deletions

View File

@ -169,9 +169,13 @@ module Vagrant
cmd = File.expand_path(config.path, @env.root_path) cmd = File.expand_path(config.path, @env.root_path)
FileUtils.chmod("+x", cmd) FileUtils.chmod("+x", cmd)
cmd << " #{config.args.join(' ' )}" if config.args
if Vagrant::Util::Platform.windows? if Vagrant::Util::Platform.windows?
powershell_exe = Vagrant::Util::PowerShell.executable powershell_exe = Vagrant::Util::PowerShell.executable
cmd = Shellwords.split("#{powershell_exe} #{config.powershell_args} #{cmd}") cmd = Shellwords.split("#{powershell_exe} #{config.powershell_args} #{cmd}")
else
cmd = Shellwords.split(cmd)
end end
@machine.ui.detail(I18n.t("vagrant.trigger.run.script", path: config.path)) @machine.ui.detail(I18n.t("vagrant.trigger.run.script", path: config.path))

View File

@ -30,6 +30,10 @@ Can be any valid Vagrant command. It also accepts a special value `:all` which w
* `run_remote` (hash) - A collection of settings to run a inline or remote script with on the guest. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). * `run_remote` (hash) - A collection of settings to run a inline or remote script with on the guest. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html).
* `run` (hash) - A collection of settings to run a inline or remote script with on the host. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). * `run` (hash) - A collection of settings to run a inline or remote script with on the host. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). However, at the moment the only settings `run` takes advantage of are:
+ `args`
+ `inline`
+ `path`
+ `powershell_args`
* `warn` (string) - A warning message that will be printed at the beginning of a trigger. * `warn` (string) - A warning message that will be printed at the beginning of a trigger.