Class: PsAddCommand

Inherits:
Command show all
Defined in:
lib/ukku/ps_add_command.rb

Instance Method Summary collapse

Methods inherited from Command

#load_app_info

Instance Method Details

#execute(args) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ukku/ps_add_command.rb', line 2

def execute(args)
  type = args['TYPE']

  app_info = load_app_info(args)

  puts "Adding process type '#{type}' on #{app_info[:host]} ..."
  conn = Connection.new(app_info)
  conn.execute("sudo touch /etc/ukku/ps-types/#{type}")
  begin
    conn.execute("launchapp")
  rescue Subprocess::NonZeroExit => e
  end
end