From 423a13cc957c75db7f4aa3d5b131266e3b2611da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Falk=20Ku=CC=88hnel?= Date: Thu, 27 Jun 2013 00:34:08 +0200 Subject: [PATCH] added a newline before appending it to hosts --- lib/vagrant-hostsupdater/HostsUpdater.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-hostsupdater/HostsUpdater.rb b/lib/vagrant-hostsupdater/HostsUpdater.rb index 213cfbe..84dfbd0 100644 --- a/lib/vagrant-hostsupdater/HostsUpdater.rb +++ b/lib/vagrant-hostsupdater/HostsUpdater.rb @@ -70,7 +70,7 @@ def getHostEntries(ip, hostnames, name, uuid = self.uuid) def addToHosts(entries) return if entries.length == 0 - content = entries.join("\n") + content = "\n" + entries.join("\n").strip if !File.writable?(@@hosts_path) sudo(%Q(sh -c 'echo "#{content}" >> #@@hosts_path')) else