Now checks if `unison` binary is installed before running

This commit is contained in:
Mitchell Hashimoto 2010-06-20 14:38:58 -07:00
parent e8fd57fbbb
commit 47403e16cc
3 changed files with 8 additions and 1 deletions

View File

@ -57,10 +57,10 @@ module Vagrant
def setup_unison
return if unison_folders.empty?
logger.info "Setting up unison crontab..."
runner.ssh.execute do |ssh|
runner.system.prepare_unison(ssh)
logger.info "Creating unison crontab entries..."
unison_folders.each do |name, data|
runner.system.create_unison(ssh, data)
end

View File

@ -53,6 +53,8 @@ module Vagrant
end
def prepare_unison(ssh)
ssh.exec!("which unison", :error_key => :unison_not_found)
logger.info "Preparing system for unison sync..."
vm.ssh.upload!(StringIO.new(TemplateRenderer.render('/unison/script')), config.unison.script)
ssh.exec!("sudo chmod +x #{config.unison.script}")

View File

@ -212,6 +212,11 @@
:system_unspecified: |-
A VM system type must be specified! This is done via the `config.vm.system`
configuration value. Please read the documentation online for more information.
:unison_not_found: |-
The `unison` binary was not found on the guest machine. This is required
for folder syncing via unison. Please install unison on your system to
use folder syncing. You may also disable folder syncing, install unison,
re-enable syncing, then call a `vagrant reload` to enable syncing.
:unknown_vm: |-
The specified VM could not be found: <%= vm %>
:virtualbox_import_failure: |-