vagrant-scp-sync 0.5.27 → 0.5.29

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
  SHA256:
3
- metadata.gz: b57515d717378b1daf432022a6c9b288503e116b08645bb0ddaa89a14719c295
4
- data.tar.gz: 5c26d7d94fd7dbafc95efe661617d27c7b4ddbf345b537af7c20a4ef354a2d7c
3
+ metadata.gz: 1e6fff32d2f23ee09ce112e39db45b72ee7117720ff2b078562371766080cb67
4
+ data.tar.gz: d8c68a712df3172bca3e79fb0efe992d8b49018b1e61c2676196b8f28e6c4b8b
5
5
  SHA512:
6
- metadata.gz: 90334be946bf82fea5f69fa97f3070e75dec9ee07baa8829d86b995c32bc0138077a956fe065cd69dbac04a3b2f94b3cb565d5f327b0b3709a9ea23082168b2c
7
- data.tar.gz: 19d2079b97289af6d5366367d58b299fd10a9263603f89e167e34b32652e1cabe58c8c8687c5b5a689f60a5e87697cae56fe662aa90d7f3081fc6a18adf652a8
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
- target_check = build_ssh_command(ssh_opts, "test -e '#{target_files}' && echo 'EXISTS' || echo 'NOT_EXISTS'", ssh_info)
46
- target_type_check = build_ssh_command(ssh_opts, "test -d '#{target_files}' && echo 'DIR' || echo 'FILE'", ssh_info)
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]}:'#{target_files}'"
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]}:'#{target_files}/#{File.basename(source_files)}'"
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 = target_files
70
- target_dir = File.dirname(target_files) unless target_is_dir || has_trailing_slash_target
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 '#{target_files}'", ssh_info) if delete
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
- source = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{source_files}'"
80
- source = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{source_files}'/*" if has_trailing_slash_source
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
- # Create local target directory without sudo
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Vagrant
4
4
  module ScpSync
5
- VERSION = '0.5.27'
5
+ VERSION = '0.5.29'
6
6
  NAME = 'vagrant-scp-sync'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-scp-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.27
4
+ version: 0.5.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gilbert