Merge pull request #147 from jsenin/show_message_if_not_apps

Show a message when no apps installed
pull/187/head
Rui Carmo 2021-01-21 18:42:57 +00:00 zatwierdzone przez GitHub
commit 5e23ffcff4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -1025,10 +1025,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')