Class: Vagrant::Solaris10::Cap::MountVmwareSharedFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-solaris10/cap/mount_vmware_shared_folder.rb

Class Method Summary collapse

Class Method Details

.mount_vmware_shared_folder(machine, name, guestpath, options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-solaris10/cap/mount_vmware_shared_folder.rb', line 8

def self.mount_vmware_shared_folder(machine, name, guestpath, options)
  machine.communicate.tap do |comm|
    # clear prior symlink
    if comm.test("test -L \"#{guestpath}\"", sudo: true)
      comm.sudo("rm -f \"#{guestpath}\"")
    end
  
    # clear prior directory if exists
    if comm.test("test -d \"#{guestpath}\"", sudo: true)
      comm.sudo("rm -Rf \"#{guestpath}\"")
    end
  
    # finally make the symlink
    comm.sudo("ln -s \"/hgfs/#{name}\" \"#{guestpath}\"")
  end
end