vagrant-scp-sync 0.5.22 → 0.5.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 118c8a7f4131343bad9fc3f019f66c6a8df7259b0c9e7f4779737ef5edb95ad6
4
- data.tar.gz: 3ca0ee379eb5ab8a2590149a2ee4538a213340a7709055a13ea4683f258625e3
3
+ metadata.gz: dd954a17a047b7a187c76302391b434f191285e975bf8280abf01d0f4a948c8a
4
+ data.tar.gz: fd5ec7f42859cbd0a47b4f1dbfa4b91bbe8a3cbce9297824c37b86558226def7
5
5
  SHA512:
6
- metadata.gz: 411fbf3bb456ac7940e9fbd0fac4edfb65a101f14164b31cae1639194269cda1a2594851645ae79f31789a4da8e0a96ed5459228caa7de02f23b18f6308d4edb
7
- data.tar.gz: 9e6c6e515f831c6286adf8f817e60ad47ca0675e243a8c807445ea64b38b327ce0a326f05593144d22b4c5fb3de5f28280c02c0ce67abfee6e46f4545e62977d
6
+ metadata.gz: 3841a0cb505e8b30cdbcd5fef6478c839548ecbdd60ebaf132b9473e7b43f4b0b79059132d143a185abdfe063555159e006d87bae8bf651a1c483b48173c92d5
7
+ data.tar.gz: e91f0198672284f053355394d2594a2bd292a718f20a0e066793b872128f17b1c9dcd27d78067f9b7467903097e7a1c0bee45f186a0da7d0b52991b7b051a72b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.23](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.22...v0.5.23) (2025-01-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * FIle paths with quotes break things, this is an attempt to workaround/fix that ([2192a8c](https://github.com/STARTcloud/vagrant-scp-sync/commit/2192a8c97de0749dcb4038d5ea485b2b186325c8))
9
+
3
10
  ## [0.5.22](https://github.com/STARTcloud/vagrant-scp-sync/compare/v0.5.21...v0.5.22) (2025-01-14)
4
11
 
5
12
 
@@ -42,8 +42,8 @@ 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_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)
47
47
 
48
48
  # Check if target exists and its type
49
49
  target_exists = execute_command_with_output(machine, target_check).strip == 'EXISTS'
@@ -51,16 +51,16 @@ module VagrantPlugins
51
51
 
52
52
  # Determine source path based on trailing slash and directory status
53
53
  source = if is_source_directory && has_trailing_slash_source
54
- "#{source_files}/*" # Copy contents of directory
54
+ "'#{source_files}/*'" # Copy contents of directory with quotes
55
55
  else
56
- source_files # Copy directory itself or single file
56
+ "'#{source_files}'" # Copy directory itself or single file with quotes
57
57
  end
58
58
 
59
59
  # Determine target path based on existence and trailing slash
60
- target_base = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{target_files}"
60
+ target_base = "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{target_files}'"
61
61
  target = if target_exists && target_is_dir && !has_trailing_slash_target
62
62
  # If target exists as directory but no trailing slash, put source inside it
63
- "#{target_base}/#{File.basename(source_files)}"
63
+ "#{ssh_info[:username]}@#{ssh_info[:host]}:'#{target_files}/#{File.basename(source_files)}'"
64
64
  else
65
65
  target_base
66
66
  end
@@ -69,21 +69,21 @@ module VagrantPlugins
69
69
  target_dir = target_files
70
70
  target_dir = File.dirname(target_files) unless target_is_dir || has_trailing_slash_target
71
71
 
72
- make_dir = build_ssh_command(ssh_opts, "sudo mkdir -p #{target_dir}", ssh_info)
73
- change_ownership = build_ssh_command(ssh_opts, "sudo chown -R #{opts[:owner]}:#{opts[:group]} #{target_dir}", ssh_info)
74
- 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
72
+ make_dir = build_ssh_command(ssh_opts, "sudo mkdir -p '#{target_dir}'", ssh_info)
73
+ change_ownership = build_ssh_command(ssh_opts, "sudo chown -R #{opts[:owner]}:#{opts[:group]} '#{target_dir}'", ssh_info)
74
+ 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
76
 
77
77
  elsif opts[:direction] == :download
78
78
  # For download direction
79
- source = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{source_files}"
80
- source = "#{source}/*" if has_trailing_slash_source
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
81
81
 
82
82
  # Create local target directory without sudo
83
- target = target_files
83
+ target = "'#{target_files}'"
84
84
  target_dir = target_files
85
85
  target_dir = File.dirname(target_files) unless File.directory?(target_files) || has_trailing_slash_target
86
- make_dir = "mkdir -p #{target_dir}"
86
+ make_dir = "mkdir -p '#{target_dir}'"
87
87
  end
88
88
 
89
89
  # Execute commands silently for setup
@@ -115,7 +115,7 @@ module VagrantPlugins
115
115
  end
116
116
 
117
117
  def self.build_scp_command(scp_path, ssh_opts, source, target)
118
- [scp_path, '-r', *ssh_opts, "'#{source}'", "'#{target}'"].join(' ')
118
+ [scp_path, '-r', *ssh_opts, source, target].join(' ')
119
119
  end
120
120
 
121
121
  def self.execute_command(machine, command, raise_error, message_key, opts)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Vagrant
4
4
  module ScpSync
5
- VERSION = '0.5.22'
5
+ VERSION = '0.5.23'
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.22
4
+ version: 0.5.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gilbert