vagrant-scp-sync 0.5.13 → 0.5.14
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/CHANGELOG.md +8 -0
- data/lib/vagrant-scp-sync/action/scp_sync.rb +9 -22
- data/lib/vagrant-scp-sync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11e117ab4ab00e45911fd5b03030c4d533109adb73eac10cf0de89e813ba6485
|
4
|
+
data.tar.gz: 29f64a74a37a7fe640b22d8b16a481aa08b67a57322e5f6822d9b6e52eac4790
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1f8ad98eed1f467d3d263e918527d5f326a11561be2ed0224a866aae72eb258b4fa90e91ab1831055672ac5030448860fb11913db8b18558988f68697b64d5
|
7
|
+
data.tar.gz: 19080ca8a5a4f742f41882cd4fbee4d58e67dcfae5320c2a35a527e7e883f6c8ebbda2421a5d6a85732e7c10c5f8d22ae3c7e316c8a6f41712ca442720426436
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.5.14](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.13...v0.5.14) (2024-12-23)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* single file sync - lint ([c81fd34](https://github.com/STARTcloud/vagrant-scp-sync/commit/c81fd346a8ac76dba78244c18c0a7779baadbcf1))
|
9
|
+
* single file sync - lint ([cdeada6](https://github.com/STARTcloud/vagrant-scp-sync/commit/cdeada62478832d464b4baf73cc5c87eea58901c))
|
10
|
+
|
3
11
|
## [0.5.13](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.12...v0.5.13) (2024-12-23)
|
4
12
|
|
5
13
|
|
@@ -12,8 +12,6 @@ module VagrantPlugins
|
|
12
12
|
raise Vagrant::Errors::SSHNotReady if ssh_info.nil?
|
13
13
|
|
14
14
|
source_files = expand_path(opts[:map], machine)
|
15
|
-
has_trailing_slash_source = opts[:map].end_with?('/')
|
16
|
-
sync_source_files = append_wildcard(source_files, has_trailing_slash_source)
|
17
15
|
target_files = expand_path(opts[:to], machine)
|
18
16
|
|
19
17
|
opts[:owner] ||= ssh_info[:username]
|
@@ -25,24 +23,18 @@ module VagrantPlugins
|
|
25
23
|
delete = scp_opts.include?('--delete')
|
26
24
|
|
27
25
|
if opts[:direction] == :upload || opts[:direction].nil?
|
28
|
-
source =
|
26
|
+
source = source_files
|
29
27
|
target = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{target_files}"
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
target_dir = File.dirname(target_files)
|
29
|
+
make_dir = build_ssh_command(ssh_opts, "sudo mkdir -p #{target_dir}", ssh_info)
|
30
|
+
change_ownership = build_ssh_command(ssh_opts, "sudo chown -R #{opts[:owner]}:#{opts[:group]} #{target_dir}", ssh_info)
|
31
|
+
change_permissions = build_ssh_command(ssh_opts, "sudo chmod 777 #{target_dir}", ssh_info)
|
33
32
|
remove_dir = build_ssh_command(ssh_opts, "sudo rm -rf #{target_files}", ssh_info)
|
34
33
|
elsif opts[:direction] == :download
|
35
|
-
source = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{
|
34
|
+
source = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{source_files}"
|
36
35
|
target = target_files
|
37
|
-
|
38
|
-
|
39
|
-
if has_trailing_slash_source || target.end_with?('/')
|
40
|
-
make_dir = "mkdir -p #{target}"
|
41
|
-
else
|
42
|
-
# For file targets, only create the parent directory if it's not '.'
|
43
|
-
parent_dir = File.dirname(target)
|
44
|
-
make_dir = parent_dir == '.' ? nil : "mkdir -p #{parent_dir}"
|
45
|
-
end
|
36
|
+
target_dir = File.dirname(target_files)
|
37
|
+
make_dir = target_dir == '.' ? nil : "mkdir -p #{target_dir}"
|
46
38
|
end
|
47
39
|
|
48
40
|
synchronize = build_scp_command(scp_path, ssh_opts, source, target)
|
@@ -58,10 +50,6 @@ module VagrantPlugins
|
|
58
50
|
Vagrant::Util::Platform.fs_real_path(expanded_path).to_s
|
59
51
|
end
|
60
52
|
|
61
|
-
def self.append_wildcard(path, has_trailing_slash)
|
62
|
-
has_trailing_slash ? "#{path}/*" : path
|
63
|
-
end
|
64
|
-
|
65
53
|
def self.build_ssh_options(ssh_info)
|
66
54
|
opts = %w[
|
67
55
|
-o StrictHostKeyChecking=no
|
@@ -110,8 +98,7 @@ module VagrantPlugins
|
|
110
98
|
stderr: stderr
|
111
99
|
end
|
112
100
|
|
113
|
-
private_class_method :expand_path, :
|
114
|
-
:build_ssh_command, :build_scp_command, :execute_command, :raise_scp_error
|
101
|
+
private_class_method :expand_path, :build_ssh_options, :build_scp_options, :build_ssh_command, :build_scp_command, :execute_command, :raise_scp_error
|
115
102
|
end
|
116
103
|
end
|
117
104
|
end
|