Permalink
Browse files

more consistent timing around apps messaging

  • Loading branch information...
1 parent afda9de commit a5f41a6a21555583fd161a5d9858e488891eeba1 @geemus committed Mar 28, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/ext/heroku/command/apps.rb
@@ -29,9 +29,13 @@ def index
# -r, --raw # output info as raw key/value pairs
#
def info
+ unless options[:raw]
+ style_info("#{app} info")
+ end
+
attrs = heroku.info(app)
- if options[:raw] then
+ if options[:raw]
attrs.keys.sort_by { |a| a.to_s }.each do |key|
case key
when :addons then
@@ -77,7 +81,6 @@ def info
end
end
- style_info("#{app} info")
style_object(data)
end
end
@@ -98,9 +101,9 @@ def create
stack = extract_option('--stack', 'aspen-mri-1.8.6')
timeout = extract_option('--timeout', 30).to_i
name = args.shift.downcase.strip rescue nil
+ style_action("creating #{name}")
info = heroku.create_app(name, {:stack => stack})
name = info["name"]
- style_action("creating #{name}")
begin
if info["create_status"] == "creating"
Timeout::timeout(timeout) do
@@ -176,7 +179,7 @@ def rename
def open
info = heroku.info(app)
url = info[:web_url]
- action("opening #{url}")
+ style_action("opening #{url}")
Launchy.open url
end
@@ -192,11 +195,12 @@ def destroy
raise Heroku::Command::CommandFailed.new("Usage: heroku apps:destroy --app APP")
end
+ action("destroying #{app} (including all add-ons)")
+
heroku.info(app) # fail fast if no access or doesn't exist
message = "WARNING: Potentially Destructive Action\nThis command will destroy #{app} (including all add-ons)."
if confirm_command(app, message)
- action("destroying #{app} (including all add-ons)")
heroku.destroy(app)
if remotes = git_remotes(Dir.pwd)
remotes.each do |remote_name, remote_app|

0 comments on commit a5f41a6

Please sign in to comment.