lib/fig/protocol/ssh.rb
# Use external scp program to copy a file.
Use external scp program to copy a file.
Use external scp program to copy a file .
def scp(from, to, &error_block)
    command = ['scp', from, to]
    begin
      output, errors, result = Fig::ExternalProgram.capture command
    rescue Errno::ENOENT => error
      yield %Q<Could not run "#{command.join ' '}": #{error.message}.>
      return
    end
    if result && ! result.success?
      yield %Q<Could not run "#{command.join ' '}": #{result}: #{errors}>
      return
    end
    return output
  end
def scp ( from , to , & error_block ) command = [ 'scp' , from , to ] begin output , errors , result = Fig :: ExternalProgram . capture command rescue Errno :: ENOENT => error yield %Q<Could not run "#{command.join ' '}": #{error.message}.> return end if result && ! result . success? yield %Q<Could not run "#{command.join ' '}": #{result}: #{errors}> return end return output end
Use external scp program to copy a file.
Use external scp program to copy a file .
from
to
error_block