Dont replace Windows newlines to Unix if shell is set as binary
This commit is contained in:
parent
2c8cc95e79
commit
b20fe8d41e
|
@ -8,6 +8,7 @@ module VagrantPlugins
|
||||||
attr_accessor :upload_path
|
attr_accessor :upload_path
|
||||||
attr_accessor :args
|
attr_accessor :args
|
||||||
attr_accessor :privileged
|
attr_accessor :privileged
|
||||||
|
attr_accessor :binary
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@args = UNSET_VALUE
|
@args = UNSET_VALUE
|
||||||
|
@ -15,6 +16,7 @@ module VagrantPlugins
|
||||||
@path = UNSET_VALUE
|
@path = UNSET_VALUE
|
||||||
@upload_path = UNSET_VALUE
|
@upload_path = UNSET_VALUE
|
||||||
@privileged = UNSET_VALUE
|
@privileged = UNSET_VALUE
|
||||||
|
@binary = UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def finalize!
|
def finalize!
|
||||||
|
@ -23,6 +25,7 @@ module VagrantPlugins
|
||||||
@path = nil if @path == UNSET_VALUE
|
@path = nil if @path == UNSET_VALUE
|
||||||
@upload_path = "/tmp/vagrant-shell" if @upload_path == UNSET_VALUE
|
@upload_path = "/tmp/vagrant-shell" if @upload_path == UNSET_VALUE
|
||||||
@privileged = true if @privileged == UNSET_VALUE
|
@privileged = true if @privileged == UNSET_VALUE
|
||||||
|
@binary = false if @binary == UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate(machine)
|
def validate(machine)
|
||||||
|
|
|
@ -71,8 +71,8 @@ module VagrantPlugins
|
||||||
script = config.inline
|
script = config.inline
|
||||||
end
|
end
|
||||||
|
|
||||||
# Replace Windows line endings with Unix ones
|
# Replace Windows line endings with Unix ones unless binary file
|
||||||
script.gsub!(/\r\n?$/, "\n")
|
script.gsub!(/\r\n?$/, "\n") unless config.binary
|
||||||
|
|
||||||
# Otherwise we have an inline script, we need to Tempfile it,
|
# Otherwise we have an inline script, we need to Tempfile it,
|
||||||
# and handle it specially...
|
# and handle it specially...
|
||||||
|
|
Loading…
Reference in New Issue