vagrant-scp-sync 0.5.27 → 0.5.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/vagrant-scp-sync/action/scp_sync.rb +10 -7
- 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: bf6209e986838ed0df71e3def682be412a7c9bc67272bcd82761533dd4dc9a17
|
4
|
+
data.tar.gz: b09da588cf177e7b102414f5c1984ad3f5082d8dbc54af7717efb5cfb10444f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbdc62a90063f5c4592826cb26c98848d88de8adfbce15249d329c07a5d62211b3091a6a5adf807faba350f042463f3c31a4b0023febabef7fb7eacf6a87ea4c
|
7
|
+
data.tar.gz: 8521432666f398a5fedea53cd5c8043ea16b0ca8c63890dd8fa6d077c334efb209db02fbf70a00d3f18258b00fe8f9b2515c7626ceb0f671fdee8ada9683fa75
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.5.28](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.27...v0.5.28) (2025-01-15)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* 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))
|
9
|
+
* 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))
|
10
|
+
|
3
11
|
## [0.5.27](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.26...v0.5.27) (2025-01-15)
|
4
12
|
|
5
13
|
|
@@ -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,22 +58,22 @@ 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
|
@@ -115,6 +116,8 @@ module VagrantPlugins
|
|
115
116
|
end
|
116
117
|
|
117
118
|
def self.build_scp_command(scp_path, ssh_opts, source, target)
|
119
|
+
# Quote the scp path if it contains spaces
|
120
|
+
scp_path = "'#{scp_path}'" if scp_path.include?(' ')
|
118
121
|
[scp_path, '-r', *ssh_opts, source, target].join(' ')
|
119
122
|
end
|
120
123
|
|