Replace '\' with '/' on synced folders on Windows

This commit is contained in:
Mitchell Hashimoto 2013-07-23 13:27:03 -07:00
parent c0404e3f63
commit fc7c8b1e99
2 changed files with 8 additions and 0 deletions

View File

@ -63,6 +63,8 @@ BUG FIXES:
- With forward agent enabled and sudo being used, Vagrant will automatically
discover and set `SSH_AUTH_SOCK` remotely so that forward agent
works properly despite misconfigured sudoers. [GH-1307]
- Synced folder paths on Windows containing '\' are replaced with
'/' internally so that they work properly.
## 1.2.4 (July 16, 2013)

View File

@ -125,6 +125,12 @@ module VagrantPlugins
# folder.
# @param [Hash] options Additional options.
def synced_folder(hostpath, guestpath, options=nil)
if Vagrant::Util::Platform.windows?
# On Windows, Ruby just uses normal '/' for path seps, so
# just replace normal Windows style seps with Unix ones.
hostpath.gsub!("\\", "/")
end
options ||= {}
options[:guestpath] = guestpath.to_s.gsub(/\/$/, '')
options[:hostpath] = hostpath