Class: VagrantPlugins::Unison::CommandOnce

Inherits:
Object
  • Object
show all
Includes:
UnisonSync
Defined in:
lib/vagrant-unison2/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from UnisonSync

#check_conflicting_options!, #execute_sync_command, #options, #options_parser, #parse_options!

Class Method Details

.synopsisObject



15
16
17
# File 'lib/vagrant-unison2/command.rb', line 15

def self.synopsis
  "sync the unison shared folder once"
end

Instance Method Details

#executeObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vagrant-unison2/command.rb', line 19

def execute
  status = nil
  with_target_vms do |machine|
    execute_sync_command(machine) do |command|
      command.batch = true
      command.terse = true
      command = command.to_s

      @env.ui.info "Running unison once"
      @env.ui.info "    #{command}"

      status = system(command)
      @env.ui.info "**** unison exited. success: #{status} ****"
    end
  end
  if status
    return 0
  else
    return 1
  end
end