Sort shared folders by length only if they have a guest path
This commit is contained in:
parent
ec68c0a655
commit
28cc13ad38
|
@ -1,6 +1,7 @@
|
|||
## 0.8.8 (unreleased)
|
||||
|
||||
|
||||
- Mount shared folders shortest to longest to avoid mounting
|
||||
subfolders first. [GH-525]
|
||||
|
||||
## 0.8.7 (September 13, 2011)
|
||||
|
||||
|
|
|
@ -52,7 +52,17 @@ module Vagrant
|
|||
|
||||
@env["vm"].ssh.execute do |ssh|
|
||||
# short guestpaths first, so we don't step on ourselves
|
||||
shared_folders.sort_by {|name, data| data[:guestpath].length}.each do |name, data|
|
||||
folders = shared_folders.sort_by do |name, data|
|
||||
if data[:guestpath]
|
||||
data[:guestpath].length
|
||||
else
|
||||
# A long enough path to just do this at the end.
|
||||
10000
|
||||
end
|
||||
end
|
||||
|
||||
# Go through each folder and mount
|
||||
folders.each do |name, data|
|
||||
if data[:guestpath]
|
||||
# Guest path specified, so mount the folder to specified point
|
||||
@env.ui.info(I18n.t("vagrant.actions.vm.share_folders.mounting_entry",
|
||||
|
|
Loading…
Reference in New Issue