From 03262b0a046ee641b01157c57c60869d256d8b4c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Jun 2010 23:42:45 -0700 Subject: [PATCH] Remove sync TO folder for unison prior to setting up cron --- lib/vagrant/systems/linux.rb | 2 ++ test/vagrant/systems/linux_test.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 62ee4ac22..10dc7021c 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -69,6 +69,8 @@ module Vagrant :options => config.unison.options, :script => config.unison.script, :log_file => (config.unison.log_file % sanitized_string)) + + 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}") end diff --git a/test/vagrant/systems/linux_test.rb b/test/vagrant/systems/linux_test.rb index 3708c695b..e10220069 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 original guestpath" do + @ssh.expects(:exec!).with("sudo rm -rf #{@options[:original][:guestpath]}") + @instance.create_unison(@ssh, @options) + end + should "enable the crontab file" do @ssh.expects(:exec!).with("crontab #{@mock_env.config.unison.crontab_entry_file}") @instance.create_unison(@ssh, @options)