vagrant-syncer 1.1.7 → 1.1.8
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.
- checksums.yaml +4 -4
- data/lib/syncer/actions.rb +4 -2
- data/lib/syncer/command/rsync.rb +1 -1
- data/lib/syncer/machine.rb +6 -2
- data/lib/syncer/syncers/rsync.rb +6 -5
- data/lib/syncer/version.rb +1 -1
- data/locales/en.yml +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87f0de4b26b2a4925479368125aeebb54acd4746
|
4
|
+
data.tar.gz: b65baa6db0cdbf65635145d1e0df18ba262c671a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed08fa4bc963c82f076a03df602ca51a719633379c120669b6c704c0b56b997115fb8bbd0eeab216f95efae085d8f67a0c8a4e8144a2e0aa9553f174fc478ec9
|
7
|
+
data.tar.gz: cf46a519718b0beaad24c91b5d786b83034712990afa9178ac23d08429cdb01a598be214049a1ede52cb246b2f7065d11862b09bc0d653601ed8b0c040abea66
|
data/lib/syncer/actions.rb
CHANGED
@@ -15,8 +15,10 @@ module Vagrant
|
|
15
15
|
return if @exit_registered
|
16
16
|
|
17
17
|
at_exit do
|
18
|
-
|
19
|
-
|
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")
|
data/lib/syncer/command/rsync.rb
CHANGED
@@ -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
|
49
|
+
target_machine = Machine.new(machine)
|
50
50
|
target_machine.full_sync if machine.ssh_info
|
51
51
|
end
|
52
52
|
|
data/lib/syncer/machine.rb
CHANGED
@@ -65,7 +65,11 @@ module Vagrant
|
|
65
65
|
|
66
66
|
def full_sync
|
67
67
|
@syncers.each do |syncer|
|
68
|
-
|
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
|
-
|
80
|
+
host_path: path,
|
77
81
|
listener: @listener_name,
|
78
82
|
interval: @listener_interval
|
79
83
|
}))
|
data/lib/syncer/syncers/rsync.rb
CHANGED
@@ -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}:#{
|
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:
|
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|
|
data/lib/syncer/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
en:
|
2
2
|
syncer:
|
3
3
|
states:
|
4
|
-
initial: "Rsyncing %{
|
5
|
-
watching: "Watching %{
|
6
|
-
polling: "Polling %{
|
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}"
|