provisioners/shelL: don't replace windows lineendings for WinRM

This commit is contained in:
Mitchell Hashimoto 2014-04-11 21:32:28 -07:00
parent 15fe061004
commit aca8c4f8f3
1 changed files with 10 additions and 3 deletions

View File

@ -88,8 +88,12 @@ module VagrantPlugins
"#{@machine.id}-remote-script") "#{@machine.id}-remote-script")
download_path.delete if download_path.file? download_path.delete if download_path.file?
begin
Vagrant::Util::Downloader.new(config.path, download_path).download! Vagrant::Util::Downloader.new(config.path, download_path).download!
script = download_path.read script = download_path.read
ensure
download_path.delete if download_path.file?
end
download_path.delete download_path.delete
elsif config.path elsif config.path
@ -102,7 +106,10 @@ module VagrantPlugins
end end
# Replace Windows line endings with Unix ones unless binary file # Replace Windows line endings with Unix ones unless binary file
script.gsub!(/\r\n?$/, "\n") if !config.binary # or we're running on Windows.
if !config.binary && config.vm.communicator != :winrm
script.gsub!(/\r\n?$/, "\n")
end
# 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...