Permalink
Browse files

Add descriptive error message on `af update`

Earlier it just said "Error: No applications." which is somewhat opaque given
you've just written `af update`.
  • Loading branch information...
1 parent 4e86271 commit dbc3afd028fc7bc87dd5bbbaaf5238d5ffb014a5 @malthejorgensen committed with May 13, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/cli/commands/apps.rb
@@ -376,14 +376,19 @@ def update(appname=nil)
upload_app_bits(appname, @path, infra)
restart appname if app[:state] == 'STARTED'
else
- each_app do |name|
+ found_app = false
+ each_app(false) do |name|
+ found_app = true
display "Updating application '#{name}'..."
app = client.app_info(name)
infra = app[:infra] ? app[:infra][:provider] : nil
upload_app_bits(name, @application, infra)
restart name if app[:state] == 'STARTED'
end
+ if !found_app
+ err "No applications found.\nEither specify an app on the command line, or in 'manifest.yml'."
+ end
end
end

0 comments on commit dbc3afd

Please sign in to comment.