provisioners/shell: rename shell_args to powershell-args

This commit is contained in:
Mitchell Hashimoto 2014-10-23 09:53:14 -07:00
parent f0a4e26d27
commit 3f01a99148
3 changed files with 12 additions and 11 deletions

View File

@ -45,6 +45,7 @@ BUG FIXES:
- provisioners/docker: Get GPG key over SSL. [GH-4597]
- provisioners/docker: Search for docker binary in multiple places. [GH-4580]
- provisioners/salt: Highstate works properly with a master. [GH-4471]
- provisioners/shell: PowerShell scripts can have args. [GH-4548]
- synced\_folders/nfs: Don't modify NFS exports file if no exports. [GH-4619]
PLUGIN AUTHOR CHANGES:

View File

@ -10,7 +10,7 @@ module VagrantPlugins
attr_accessor :privileged
attr_accessor :binary
attr_accessor :keep_color
attr_accessor :shell_args
attr_accessor :powershell_args
def initialize
@args = UNSET_VALUE
@ -20,7 +20,7 @@ module VagrantPlugins
@privileged = UNSET_VALUE
@binary = UNSET_VALUE
@keep_color = UNSET_VALUE
@shell_args = UNSET_VALUE
@powershell_args = UNSET_VALUE
end
def finalize!
@ -31,7 +31,7 @@ module VagrantPlugins
@privileged = true if @privileged == UNSET_VALUE
@binary = false if @binary == UNSET_VALUE
@keep_color = false if @keep_color == UNSET_VALUE
@shell_args = "-ExecutionPolicy Bypass" if @shell_args == UNSET_VALUE
@powershell_args = "-ExecutionPolicy Bypass" if @powershell_args == UNSET_VALUE
if @args && args_valid?
@args = @args.is_a?(Array) ? @args.map { |a| a.to_s } : @args.to_s

View File

@ -100,15 +100,15 @@ module VagrantPlugins
exec_path.gsub!('/', '\\')
exec_path = "c:#{exec_path}" if exec_path.start_with?("\\")
# Copy shell_args from configuration
shell_args = config.shell_args
# Copy powershell_args from configuration
shell_args = config.powershell_args
# For PowerShell scripts bypass the execution policy unless already specified
shell_args += " -ExecutionPolicy Bypass" if config.shell_args !~ /[-\/]ExecutionPolicy/i
# CLIXML output is kinda useless, especially on non-windows hosts
shell_args += " -OutputFormat Text" if config.shell_args !~ /[-\/]OutputFormat/i
shell_args += " -ExecutionPolicy Bypass" if config.powershell_args !~ /[-\/]ExecutionPolicy/i
# CLIXML output is kinda useless, especially on non-windows hosts
shell_args += " -OutputFormat Text" if config.powershell_args !~ /[-\/]OutputFormat/i
command = "#{exec_path}#{args}"
command = "powershell #{shell_args.to_s} -file #{command}" if
File.extname(exec_path).downcase == '.ps1'