lib/rundock/backend.rb in rundock-0.2.11 vs lib/rundock/backend.rb in rundock-0.3.0

- old
+ new

@@ -30,9 +30,20 @@ Array(cmd).each do |c| run_command(c, exec_options) end end + def send_file(from, to) + system("test -d #{from}") + recursive = $?.to_i == 0 + + if !recursive + @backend.send_file(from, to) + else + @backend.send_directory(from, to) + end + end + private def run_command(cmd, exec_options = {}) command = cmd.strip command = "cd #{Shellwords.escape(exec_options[:cwd])} && #{command}" if exec_options[:cwd]