Show a message when no apps installed

I think it is better to say that there is no app in the system instead of returning nothing
pull/147/head
Jorge Senín 2019-11-24 02:43:11 +01:00
rodzic 68351f56b8
commit ebeeb6824b
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -1017,10 +1017,14 @@ def cleanup(ctx):
# --- User commands ---
@piku.command("apps")
def list_apps():
def cmd_apps():
"""List apps, e.g.: piku apps"""
apps = listdir(APP_ROOT)
if not apps:
echo("There is no application yet.")
return
for a in listdir(APP_ROOT):
for a in apps:
running = len(glob(join(UWSGI_ENABLED, '{}*.ini'.format(a)))) != 0
echo(('*' if running else ' ') + a, fg='green')