Method: Geordi::Remote#shell

Defined in:
lib/geordi/remote.rb

#shell(options = {}) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/geordi/remote.rb', line 59

def shell(options = {})
  server = options[:select_server] ? select_server : @config.primary_server

  remote_command = "cd #{@config.remote_root} && #{@config.shell}"
  remote_command << " -c '#{options[:remote_command]}'" if options[:remote_command]

  note 'Connecting to ' + server.to_s
  Util.system! 'ssh', "#{ @config.user(server) }@#{ server }", '-t', remote_command
end