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

Commit

Permalink
Merge pull request #17 from mbarton/master
Browse files Browse the repository at this point in the history
Use /cygdrive when rsyncing on Windows
  • Loading branch information
Kyle Rames committed Aug 21, 2013
2 parents b6a6c6b + 591d0cb commit 53f4e10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/vagrant-rackspace/action/sync_folders.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "log4r"

require 'rbconfig'
require "vagrant/util/subprocess"

module VagrantPlugins
Expand All @@ -11,6 +11,7 @@ class SyncFolders
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_rackspace::action::sync_folders")
@host_os = RbConfig::CONFIG['host_os']
end

def call(env)
Expand All @@ -25,6 +26,11 @@ def call(env)
# Make sure there is a trailing slash on the host path to
# avoid creating an additional directory with rsync
hostpath = "#{hostpath}/" if hostpath !~ /\/$/

# If on Windows, modify the path to work with cygwin rsync
if @host_os =~ /mswin|mingw|cygwin/
hostpath = hostpath.sub(/^([A-Za-z]):\//, "/cygdrive/#{$1.downcase}/")
end

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

0 comments on commit 53f4e10

Please sign in to comment.