Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixes for ps list and standardize empty array treatment

  • Loading branch information...
commit c8eee2a1ffdcd3a3bd4cdba5746c52a67e1fe01d 1 parent 9be38ca
@geemus authored
Showing with 11 additions and 7 deletions.
  1. +1 −1  lib/ext/heroku/command/apps.rb
  2. +10 −6 lib/ext/heroku/command/ps.rb
View
2  lib/ext/heroku/command/apps.rb
@@ -16,7 +16,7 @@ def index
list.map {|name, owner| apps_by_owner[owner] << name}
style_object(apps_by_owner)
else
- hputs("You have no apps.")
+ hputs(" You have no apps.")
end
end
View
16 lib/ext/heroku/command/ps.rb
@@ -57,14 +57,18 @@ def workers
# list processes for an app
#
def index
- ps = heroku.ps(app)
-
style_info("#{app} processes by command")
- data = Hash.new {|hash,key| hash[key] = {}}
- ps.each do |p|
- data["`#{p['command']}`"][p['process']] = "#{p['state']} for #{time_ago(p['elapsed']).gsub(/ ago/, "")}"
+
+ ps = heroku.ps(app)
+ if ps.length > 0
+ data = Hash.new {|hash,key| hash[key] = {}}
+ ps.each do |p|
+ data["`#{p['command']}`"][p['process']] = "#{p['state']} for #{time_ago(p['elapsed']).gsub(/ ago/, "")}"
+ end
+ style_object(data)
+ else
+ hputs(" You have no processes.")
end
- display_object(data)
end
# ps:restart [PROCESS]

0 comments on commit c8eee2a

Please sign in to comment.
Something went wrong with that request. Please try again.