From 3006fa35c3741496b7b3444b7f2a123b898f1237 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Jun 2010 23:54:05 -0700 Subject: [PATCH] Remove the `.unison` folder to avoid "folder is empty" error --- lib/vagrant/systems/linux.rb | 1 + test/vagrant/systems/linux_test.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 10dc7021c..44c119ec0 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -70,6 +70,7 @@ module Vagrant :script => config.unison.script, :log_file => (config.unison.log_file % sanitized_string)) + ssh.exec!("sudo rm -rf ~/.unison") ssh.exec!("sudo rm -rf #{opts[:original][:guestpath]}") ssh.exec!("sudo echo \"#{crontab_entry}\" >> #{config.unison.crontab_entry_file}") ssh.exec!("crontab #{config.unison.crontab_entry_file}") diff --git a/test/vagrant/systems/linux_test.rb b/test/vagrant/systems/linux_test.rb index e10220069..1928ba539 100644 --- a/test/vagrant/systems/linux_test.rb +++ b/test/vagrant/systems/linux_test.rb @@ -92,6 +92,11 @@ class LinuxSystemTest < Test::Unit::TestCase @instance.create_unison(@ssh, @options) end + should "remove the .unison directory" do + @ssh.expects(:exec!).with("sudo rm -rf ~/.unison") + @instance.create_unison(@ssh, @options) + end + should "remove the original guestpath" do @ssh.expects(:exec!).with("sudo rm -rf #{@options[:original][:guestpath]}") @instance.create_unison(@ssh, @options)