Sha256: bdfdd92d442d4dfa2a8ef466a277462a819022f90c72664bf844961ae85f82a8

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require_relative '../../helper'

module VagrantWindows
  module Guest
    module Cap
      class MountSharedFolder
        
        def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
          mount_shared_folder(machine, name, guestpath, "\\\\vboxsrv\\")
        end
        
        def self.mount_vmware_shared_folder(machine, name, guestpath, options)
          mount_shared_folder(machine, name, guestpath, "\\\\vmware-host\\Shared Folders\\")
        end
        
        protected
        
        def self.mount_shared_folder(machine, name, guestpath, vm_provider_unc_base)
          share_name = VagrantWindows::Helper.win_friendly_share_id(name)
          options = {
            :mount_point => guestpath,
            :share_name => share_name,
            :vm_provider_unc_path => vm_provider_unc_base + share_name}
          mount_script = VagrantWindows.load_script_template("mount_volume.ps1", :options => options)
          machine.communicate.execute(mount_script, {:shell => :powershell})
        end
        
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-windows-1.4.0 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.2 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.0 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.0.pre.3 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.0.pre.2 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.3.0.pre.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.2.3 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.2.2 lib/vagrant-windows/guest/cap/mount_shared_folder.rb
vagrant-windows-1.2.1 lib/vagrant-windows/guest/cap/mount_shared_folder.rb