Skip to content

Commit dbc3afd

Browse files
malthejorgensenMalthe Jørgensen
authored andcommitted
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`.
1 parent 4e86271 commit dbc3afd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/cli/commands/apps.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,19 @@ def update(appname=nil)
376376
upload_app_bits(appname, @path, infra)
377377
restart appname if app[:state] == 'STARTED'
378378
else
379-
each_app do |name|
379+
found_app = false
380+
each_app(false) do |name|
381+
found_app = true
380382
display "Updating application '#{name}'..."
381383

382384
app = client.app_info(name)
383385
infra = app[:infra] ? app[:infra][:provider] : nil
384386
upload_app_bits(name, @application, infra)
385387
restart name if app[:state] == 'STARTED'
386388
end
389+
if !found_app
390+
err "No applications found.\nEither specify an app on the command line, or in 'manifest.yml'."
391+
end
387392
end
388393
end
389394

0 commit comments

Comments
 (0)