simplessh-rb 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simplessh/session.rb +5 -2
- metadata +1 -1
data/lib/simplessh/session.rb
CHANGED
@@ -47,7 +47,10 @@ module SimpleSSH
|
|
47
47
|
|
48
48
|
exec_command("mkdir -m #{file_mode(source).to_s(8)} #{target}").flat_map do |dir_creation_res|
|
49
49
|
if dir_creation_res.success?
|
50
|
-
Dir.open(source)
|
50
|
+
Dir.open(source)
|
51
|
+
.reject { |p| p == '.' || p == '..' }
|
52
|
+
.reduce(SimpleSSH::Either.return(nil)) do |prev, name|
|
53
|
+
|
51
54
|
local_path = File.join(source, name)
|
52
55
|
remote_path = "#{target}/#{name}"
|
53
56
|
|
@@ -55,7 +58,7 @@ module SimpleSSH
|
|
55
58
|
if File.file? local_path
|
56
59
|
prev.flat_map { |s| send_file(file_mode(local_path), local_path, remote_path) }
|
57
60
|
else
|
58
|
-
prev.flat_map { |_| send_directory(local_path, remote_path) }
|
61
|
+
prev.flat_map { |_| send_directory(local_path, remote_path, &block) }
|
59
62
|
end
|
60
63
|
else
|
61
64
|
prev
|