Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 5275f9a

Browse files
author
Kyle Rames
committed
Merge branch 'master' of github.com:mitchellh/vagrant-rackspace
2 parents 72ac0a6 + 53f4e10 commit 5275f9a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/vagrant-rackspace/action/sync_folders.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require "log4r"
2-
2+
require 'rbconfig'
33
require "vagrant/util/subprocess"
44

55
module VagrantPlugins
@@ -11,6 +11,7 @@ class SyncFolders
1111
def initialize(app, env)
1212
@app = app
1313
@logger = Log4r::Logger.new("vagrant_rackspace::action::sync_folders")
14+
@host_os = RbConfig::CONFIG['host_os']
1415
end
1516

1617
def call(env)
@@ -25,6 +26,11 @@ def call(env)
2526
# Make sure there is a trailing slash on the host path to
2627
# avoid creating an additional directory with rsync
2728
hostpath = "#{hostpath}/" if hostpath !~ /\/$/
29+
30+
# If on Windows, modify the path to work with cygwin rsync
31+
if @host_os =~ /mswin|mingw|cygwin/
32+
hostpath = hostpath.sub(/^([A-Za-z]):\//, "/cygdrive/#{$1.downcase}/")
33+
end
2834

2935
env[:ui].info(I18n.t("vagrant_rackspace.rsync_folder",
3036
:hostpath => hostpath,

0 commit comments

Comments
 (0)