From 544006c16c8b16a47ea4485414554435a702a316 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 12 Oct 2012 19:51:25 -0700 Subject: [PATCH] Whitespace and such --- plugins/communicators/ssh/communicator.rb | 2 +- plugins/provisioners/shell/provisioner.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 0360c89e8..7b20ca164 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -94,7 +94,7 @@ module VagrantPlugins @logger.debug("Uploading: #{from} to #{to}") scp_connect do |scp| - # Open file read only to fix issue [GH-1036] + # Open file read only to fix issue [GH-1036] scp.upload!(File.open(from, "r"), to) end rescue RuntimeError => e diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb index 51db5e4a0..157a683fe 100644 --- a/plugins/provisioners/shell/provisioner.rb +++ b/plugins/provisioners/shell/provisioner.rb @@ -60,10 +60,12 @@ module VagrantPlugins # Otherwise we have an inline script, we need to Tempfile it, # and handle it specially... file = Tempfile.new('vagrant-shell') + # Unless you set binmode, on a Windows host the shell script will # have CRLF line endings instead of LF line endings, causing havoc # when the guest executes it. This fixes [GH-1181]. file.binmode + begin file.write(config.inline) file.fsync