diff --git a/horsy.py b/horsy.py index 0356ba8..d4bd981 100644 --- a/horsy.py +++ b/horsy.py @@ -4,7 +4,7 @@ import sys import modules.tui as tui from modules.console import cls -from modules.manager import install, uninstall +from modules.manager import install, uninstall, apps_list from modules.virustotal import add_to_cfg from modules.uploader import upload from modules.source import get_source @@ -18,7 +18,7 @@ parser.add_argument('option', help='options for horsy (install/i | uninstall/un choices=['install', 'i', 'uninstall', 'un', 'source', 's', 'update', 'u', 'list', 'l', 'upload', 'search', 'info'], nargs='?') -parser.add_argument('app', help='app to install/uninstall/download source', nargs='?') +parser.add_argument('app', help='app to do function with', nargs='?') parser.add_argument('--vt', help='your virustotal api key (account -> api key in VT)', dest='vt_key') args = parser.parse_args() @@ -87,5 +87,8 @@ if option in ['search']: if option in ['info']: info(app) +if option in ['list', 'l']: + apps_list() + if isNoArgs: input('[EXIT] Press enter to exit horsy...') diff --git a/modules/manager.py b/modules/manager.py index 6dbcc8c..5e4f2ff 100644 --- a/modules/manager.py +++ b/modules/manager.py @@ -137,3 +137,11 @@ def uninstall(package, is_gui=False): print(f"[green][OK] Launch script deleted[/]") else: print(f"[red]App {package} is not installed or doesn't have launch script[/]") + + +def apps_list(): + if os.path.exists('{0}apps'.format(horsy_vars.horsypath)): + print(f"[green]Installed apps:[/]") + for file in os.listdir('{0}apps'.format(horsy_vars.horsypath)): + if file.endswith(".bat"): + print(f"{file.split('.')[0]}")