Sha256: ec7de8083f1589605cda810a51acc0bc7d651d22d9492471fad4019f51ce1b58

Contents?: true

Size: 1.35 KB

Versions: 24

Compression:

Stored size: 1.35 KB

Contents

require "#{Vagrant::source_root}/plugins/providers/virtualbox/action/share_folders"
require_relative '../../../../../helper'

module VagrantPlugins
  module ProviderVirtualBox
    module Action
      class ShareFolders        
        include VagrantWindows::Helper

        alias_method :original_create_metadata, :create_metadata

        def create_metadata

          unless @env[:machine].is_windows?
            # don't change the shared folder name for linux guests.  We don't want the shared folder name of linux guests to be different
            # depending on whether the vagrant-windows plugin is installed or not.
            original_create_metadata
          else
            @env[:ui].info I18n.t("vagrant.actions.vm.share_folders.creating")

            folders = []
            shared_folders.each do |id, data|
              hostpath = File.expand_path(data[:hostpath], @env[:root_path])
              hostpath = Vagrant::Util::Platform.cygwin_windows_path(hostpath)

              folder_name = win_friendly_share_id(id.gsub(/[\/\/]/,'_').sub(/^_/, ''))

              folders << {
                  :name => folder_name,
                  :hostpath => hostpath,
                  :transient => data[:transient]
              }
            end

            @env[:machine].provider.driver.share_folders(folders)
          end
        end



      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
vagrant-windows-1.7.0.pre.2 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.7.0.pre.1 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.6.0 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-plugin-dummy-0.0.7 windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.6.0.pre.1 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-plugin-dummy-0.0.6 windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-plugin-dummy-0.0.5 windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.5.1 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.5.0 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.4.0 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.2 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.1 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.0 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.0.pre.3 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.0.pre.2 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.3.0.pre.1 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.2.3 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-windows-1.2.2 lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-plugin-dummy-0.0.4 windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
vagrant-plugin-dummy-0.0.3 windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb