From 1af3292e8c5766a5207a265dfce404265406f803 Mon Sep 17 00:00:00 2001 From: Kallum Jones Date: Wed, 3 Aug 2022 20:52:36 +0100 Subject: [PATCH] Check mods are installed when listing them --- src/commands/list_command.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/commands/list_command.ts b/src/commands/list_command.ts index 066107f..d9d2918 100644 --- a/src/commands/list_command.ts +++ b/src/commands/list_command.ts @@ -13,12 +13,20 @@ export class ListCommand implements Subcommand { .description("Lists installed mods") .action(() => { ModManager.execute(() => { - let tableFunc = asTable.configure ({ + const tableFunc = asTable.configure ({ title: x => chalk.cyanBright(Util.stringPrettyify(x)), delimiter: chalk.blueBright(' | '), dash: chalk.blueBright('-') }) - PrintUtils.info(tableFunc(Mods.getTrackedMods())) + + const mods = Mods.getTrackedMods(); + + if (!Util.isArrayEmpty(mods)) { + PrintUtils.info(tableFunc(Mods.getTrackedMods())) + } else { + PrintUtils.warn("There are no mods installed yet! Try mod-manager install -h to figure out more!") + } + }) }) }