Class: VagrantPlugins::Unison::CommandCleanup

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

Instance Method Summary collapse

Methods included from UnisonSync

#execute_sync_command

Instance Method Details

#executeObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/vagrant-unison-morroni/command.rb', line 102

def execute
  with_target_vms do |machine|
    guest_path = UnisonPaths.new(@env, machine).guest

    command = "rm -rf ~/Library/'Application Support'/Unison/*"
    @env.ui.info "Running #{command} on host"
    system(command)

    command = "rm -rf #{guest_path}"
    @env.ui.info "Running #{command} on guest VM"
    machine.communicate.sudo(command)

    command = "rm -rf ~/.unison"
    @env.ui.info "Running #{command} on guest VM"
    machine.communicate.sudo(command)
  end

  0
end