vagrant-digitalocean 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  require 'vagrant/util/subprocess'
2
+ require 'vagrant/util/which'
2
3
 
3
4
  module VagrantPlugins
4
5
  module DigitalOcean
@@ -16,6 +17,11 @@ module VagrantPlugins
16
17
  @machine.config.vm.synced_folders.each do |id, data|
17
18
  next if data[:disabled]
18
19
 
20
+ unless Vagrant::Util::Which.which('rsync')
21
+ env[:ui].warn I18n.t('vagrant_digital_ocean.info.rsync_missing')
22
+ break
23
+ end
24
+
19
25
  hostpath = File.expand_path(data[:hostpath], env[:root_path])
20
26
  guestpath = data[:guestpath]
21
27
 
@@ -23,6 +29,11 @@ module VagrantPlugins
23
29
  # avoid creating an additional directory with rsync
24
30
  hostpath = "#{hostpath}/" if hostpath !~ /\/$/
25
31
 
32
+ # on windows rsync.exe requires cygdrive-style paths
33
+ if Vagrant::Util::Platform.windows?
34
+ hostpath = hostpath.gsub(/^(\w):/) { "/cygdrive/#{$1}" }
35
+ end
36
+
26
37
  env[:ui].info I18n.t('vagrant_digital_ocean.info.rsyncing', {
27
38
  :hostpath => hostpath,
28
39
  :guestpath => guestpath
@@ -40,6 +51,12 @@ module VagrantPlugins
40
51
  hostpath,
41
52
  "#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
42
53
 
54
+ # we need to fix permissions when using rsync.exe on windows, see
55
+ # http://stackoverflow.com/questions/5798807/rsync-permission-denied-created-directories-have-no-permissions
56
+ if Vagrant::Util::Platform.windows?
57
+ command.insert(1, "--chmod", "ugo=rwX")
58
+ end
59
+
43
60
  r = Vagrant::Util::Subprocess.execute(*command)
44
61
  if r.exit_code != 0
45
62
  raise Errors::RsyncError,
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DigitalOcean
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-01 00:00:00.000000000 Z
12
+ date: 2013-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday