Check mods are installed when listing them

This commit is contained in:
Kallum Jones 2022-08-03 20:52:36 +01:00
parent 5f13645122
commit 1af3292e8c
No known key found for this signature in database
GPG Key ID: D7F4589C4D7F81A9

View File

@ -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!")
}
})
})
}