Class: Frank::Publish::ShellSCP

Inherits:
Object
  • Object
show all
Defined in:
lib/frank/publish/shell_scp.rb

Overview

TODO

Class Method Summary collapse

Class Method Details

.shell_copy(local_dir, remote_dir, options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/frank/publish/shell_scp.rb', line 9

def self.shell_copy(local_dir, remote_dir, options)

  host = []
  command = ["scp "]
  command << "-P #{options[:port]} " if options[:port]
  command << "-r #{local_dir}/* "
  host << "#{options[:username]}" if options[:username]
  host << ":#{options[:password]}" if options[:password]
  host << "@#{options[:host]}:#{remote_dir}"

  shell_command = "#{command.join('')}#{host.join('')}"
  system(shell_command)

end