lib/vagrant-vaimo-unison/command.rb in vagrant-vaimo-unison-2.0.1 vs lib/vagrant-vaimo-unison/command.rb in vagrant-vaimo-unison-2.0.2

- old
+ new

@@ -118,20 +118,23 @@ end end # Command Cleanup class CommandCleanup < Vagrant.plugin('2', :command) + include UnisonSync + def self.synopsis 'Remove archives and configuration from host and guest. Keeps files in guest (need to remove manually if needed)' end def execute with_target_vms do |machine| + ssh_user = machine.config.unison.ssh_user command = "rm -rf ~/Library/'Application Support'/Unison/*" @env.ui.info "Running #{command} on host" if options[:verbose] system(command) - command = 'rm -rf ~/.unison' + command = "sudo -H -u #{ssh_user} sh -c 'rm -rf ~/.unison'" @env.ui.info "Running #{command} on guest VM" if options[:verbose] machine.communicate.execute(command) end 0