vagrant-syncer 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df7339055662081551ead92ca8baf31151e1f4cc
4
- data.tar.gz: 9c94aa4f7a88f3c2f68aa5e89157ebf52472539b
3
+ metadata.gz: 87f0de4b26b2a4925479368125aeebb54acd4746
4
+ data.tar.gz: b65baa6db0cdbf65635145d1e0df18ba262c671a
5
5
  SHA512:
6
- metadata.gz: 260f98e46518294da614ed692644ad823281f0198ee65de515ec5af9fdf8af5e4db79f6d8e3edf0464f7d07b309f510ee184a89fd970c4f1b8849de1671bd09a
7
- data.tar.gz: 306fa08765ae37fdf5b52ec5801214133b97d0d5afd05f6309dbf29ffb5b85e08456a3cd5de0b07145e6d4f1fe9aaf505868d126a35227279c4c4fe14c142eba
6
+ metadata.gz: ed08fa4bc963c82f076a03df602ca51a719633379c120669b6c704c0b56b997115fb8bbd0eeab216f95efae085d8f67a0c8a4e8144a2e0aa9553f174fc478ec9
7
+ data.tar.gz: cf46a519718b0beaad24c91b5d786b83034712990afa9178ac23d08429cdb01a598be214049a1ede52cb246b2f7065d11862b09bc0d653601ed8b0c040abea66
@@ -15,8 +15,10 @@ module Vagrant
15
15
  return if @exit_registered
16
16
 
17
17
  at_exit do
18
- exit_status = $!.status
19
- exit exit_status if exit_status != 0
18
+ if $!
19
+ exit_status = $!.status
20
+ exit exit_status if exit_status != 0
21
+ end
20
22
 
21
23
  # If vagrant up/reload/resume exited successfully, run rsync-auto.
22
24
  env[:machine].env.cli("rsync-auto")
@@ -46,7 +46,7 @@ module Vagrant
46
46
  next unless machine.communicate.ready?
47
47
  next unless synced_folders(machine)[:rsync]
48
48
 
49
- target_machine = Machine.new(machine, options[:poll])
49
+ target_machine = Machine.new(machine)
50
50
  target_machine.full_sync if machine.ssh_info
51
51
  end
52
52
 
@@ -65,7 +65,11 @@ module Vagrant
65
65
 
66
66
  def full_sync
67
67
  @syncers.each do |syncer|
68
- syncer.sync([syncer.host_path])
68
+ @logger.info(I18n.t('syncer.states.initial', {
69
+ host_path: syncer.host_path,
70
+ guest_path: syncer.guest_path
71
+ }))
72
+ syncer.sync([syncer.host_path], initial=true)
69
73
  end
70
74
  end
71
75
 
@@ -73,7 +77,7 @@ module Vagrant
73
77
  text = @listener_polling ? 'syncer.states.polling' : 'syncer.states.watching'
74
78
  @paths.each do |path|
75
79
  @logger.info(I18n.t(text, {
76
- path: path,
80
+ host_path: path,
77
81
  listener: @listener_name,
78
82
  interval: @listener_interval
79
83
  }))
@@ -6,7 +6,7 @@ module Vagrant
6
6
  module Syncers
7
7
  class Rsync
8
8
 
9
- attr_reader :host_path
9
+ attr_reader :host_path, :guest_path
10
10
 
11
11
  def initialize(path_opts, machine)
12
12
  @machine = machine
@@ -14,6 +14,7 @@ module Vagrant
14
14
 
15
15
  @machine_path = machine.env.root_path.to_s
16
16
  @host_path = parse_host_path(path_opts[:hostpath])
17
+ @guest_path = path_opts[:guestpath]
17
18
  @rsync_verbose = path_opts[:rsync__verbose] || false
18
19
  @rsync_args = parse_rsync_args(path_opts[:rsync__args],
19
20
  path_opts[:rsync__rsync_path])
@@ -22,14 +23,14 @@ module Vagrant
22
23
 
23
24
  ssh_username = machine.ssh_info[:username]
24
25
  ssh_host = machine.ssh_info[:host]
25
- @ssh_target = "#{ssh_username}@#{ssh_host}:#{path_opts[:guestpath]}"
26
+ @ssh_target = "#{ssh_username}@#{ssh_host}:#{@guest_path}"
26
27
 
27
28
  @vagrant_command_opts = {
28
29
  workdir: @machine_path
29
30
  }
30
31
 
31
32
  @vagrant_rsync_opts = {
32
- guestpath: path_opts[:guestpath],
33
+ guestpath: @guest_path,
33
34
  chown: path_opts[:rsync__chown],
34
35
  owner: path_opts[:owner],
35
36
  group: path_opts[:group]
@@ -45,7 +46,7 @@ module Vagrant
45
46
  end
46
47
  end
47
48
 
48
- def sync(changed_paths=[])
49
+ def sync(changed_paths=[], initial=false)
49
50
  rsync_command = [
50
51
  "rsync",
51
52
  @rsync_args,
@@ -57,7 +58,7 @@ module Vagrant
57
58
  ].flatten
58
59
 
59
60
  rsync_vagrant_command = rsync_command + [@vagrant_command_opts]
60
- if @rsync_verbose
61
+ if !initial && @rsync_verbose
61
62
  @vagrant_command_opts[:notify] = [:stdout, :stderr]
62
63
  result = Vagrant::Util::Subprocess.execute(*rsync_vagrant_command) do |io_name, data|
63
64
  data.each_line do |line|
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Syncer
3
- VERSION = "1.1.7"
3
+ VERSION = "1.1.8"
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  en:
2
2
  syncer:
3
3
  states:
4
- initial: "Rsyncing %{path}"
5
- watching: "Watching %{path} (using %{listener}) every %{interval} seconds."
6
- polling: "Polling %{path} (using %{listener}) every %{interval} seconds."
4
+ initial: "Rsyncing %{host_path} -> %{guest_path} get it up to date."
5
+ watching: "Watching %{host_path} (using %{listener}) every %{interval} seconds."
6
+ polling: "Polling %{host_path} (using %{listener}) every %{interval} seconds."
7
7
  rsync:
8
8
  failed: "Rsync failed: %{error}"
9
9
  failed_command: "The failed command was: %{command}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-syncer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anssi Syrjäsalo