vagrant-scp-sync 0.5.27 → 0.5.29
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 +15 -0
- data/lib/vagrant-scp-sync/action/scp_sync.rb +14 -10
- 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: 1e6fff32d2f23ee09ce112e39db45b72ee7117720ff2b078562371766080cb67
|
4
|
+
data.tar.gz: d8c68a712df3172bca3e79fb0efe992d8b49018b1e61c2676196b8f28e6c4b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10cb802bd3303a68a06865ba1abe2e91d48fdc79e37a6dd76cdada3e25f8b19292d7427b624d93a0e60e10f45fe05b5aeac2f2ded96890d0de19335e490bd72
|
7
|
+
data.tar.gz: 95244808474dc8f5710d22c50187b1c3e7c69fee7e23ce13918d6968881db5630e605f1ea3003e761e55a98e83213e6ad453318fc2a4493e9d61b0dcffb0840f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.5.29](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.28...v0.5.29) (2025-01-15)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* FIle paths with quotes break things, this is an attempt to workaround/fix that ([85420aa](https://github.com/STARTcloud/vagrant-scp-sync/commit/85420aab0ad2a182c2f866278074e046c6efa1c0))
|
9
|
+
|
10
|
+
## [0.5.28](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.27...v0.5.28) (2025-01-15)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* FIle paths with quotes break things, this is an attempt to workaround/fix that - making rubocop happy ([08d661f](https://github.com/STARTcloud/vagrant-scp-sync/commit/08d661f6a63e894d9f012d4969e99053c259dde1))
|
16
|
+
* FIle paths with quotes break things, this is an attempt to workaround/fix that - making rubocop happy ([9a305a1](https://github.com/STARTcloud/vagrant-scp-sync/commit/9a305a16fe0bf43cf61c16260ad2e04c79663deb))
|
17
|
+
|
3
18
|
## [0.5.27](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.26...v0.5.27) (2025-01-15)
|
4
19
|
|
5
20
|
|
@@ -42,8 +42,9 @@ module VagrantPlugins
|
|
42
42
|
|
43
43
|
if opts[:direction] == :upload || opts[:direction].nil?
|
44
44
|
# For upload direction
|
45
|
-
|
46
|
-
|
45
|
+
target_path = opts[:to]
|
46
|
+
target_check = build_ssh_command(ssh_opts, "test -e '#{target_path}' && echo 'EXISTS' || echo 'NOT_EXISTS'", ssh_info)
|
47
|
+
target_type_check = build_ssh_command(ssh_opts, "test -d '#{target_path}' && echo 'DIR' || echo 'FILE'", ssh_info)
|
47
48
|
|
48
49
|
# Check if target exists and its type
|
49
50
|
target_exists = execute_command_with_output(machine, target_check).strip == 'EXISTS'
|
@@ -57,29 +58,30 @@ module VagrantPlugins
|
|
57
58
|
end
|
58
59
|
|
59
60
|
# Determine target path based on existence and trailing slash
|
60
|
-
target_base = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{
|
61
|
+
target_base = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{target_path}'"
|
61
62
|
target = if target_exists && target_is_dir && !has_trailing_slash_target
|
62
63
|
# If target exists as directory but no trailing slash, put source inside it
|
63
|
-
"#{ssh_info[:username]}@#{ssh_info[:host]}:'#{
|
64
|
+
"#{ssh_info[:username]}@#{ssh_info[:host]}:'#{target_path}/#{File.basename(source_files)}'"
|
64
65
|
else
|
65
66
|
target_base
|
66
67
|
end
|
67
68
|
|
68
69
|
# Prepare remote target directory with proper permissions
|
69
|
-
target_dir =
|
70
|
-
target_dir = File.dirname(
|
70
|
+
target_dir = target_path
|
71
|
+
target_dir = File.dirname(target_path) unless target_is_dir || has_trailing_slash_target
|
71
72
|
|
72
73
|
make_dir = build_ssh_command(ssh_opts, "sudo mkdir -p '#{target_dir}'", ssh_info)
|
73
74
|
change_ownership = build_ssh_command(ssh_opts, "sudo chown -R #{opts[:owner]}:#{opts[:group]} '#{target_dir}'", ssh_info)
|
74
75
|
change_permissions = build_ssh_command(ssh_opts, "sudo chmod -R 777 '#{target_dir}'", ssh_info)
|
75
|
-
remove_dir = build_ssh_command(ssh_opts, "sudo rm -rf '#{
|
76
|
+
remove_dir = build_ssh_command(ssh_opts, "sudo rm -rf '#{target_path}'", ssh_info) if delete
|
76
77
|
|
77
78
|
elsif opts[:direction] == :download
|
78
79
|
# For download direction
|
79
|
-
|
80
|
-
source = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{
|
80
|
+
# Use original path for VM side
|
81
|
+
source = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{opts[:map]}'"
|
82
|
+
source = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{opts[:map]}'/*" if has_trailing_slash_source
|
81
83
|
|
82
|
-
#
|
84
|
+
# Use expanded path for local side
|
83
85
|
target = "'#{target_files}'"
|
84
86
|
target_dir = target_files
|
85
87
|
target_dir = File.dirname(target_files) unless File.directory?(target_files) || has_trailing_slash_target
|
@@ -115,6 +117,8 @@ module VagrantPlugins
|
|
115
117
|
end
|
116
118
|
|
117
119
|
def self.build_scp_command(scp_path, ssh_opts, source, target)
|
120
|
+
# Quote the scp path if it contains spaces
|
121
|
+
scp_path = "'#{scp_path}'" if scp_path.include?(' ')
|
118
122
|
[scp_path, '-r', *ssh_opts, source, target].join(' ')
|
119
123
|
end
|
120
124
|
|