mod-manager/src/commands/uninstall_command.ts
2022-08-04 16:04:21 +01:00

20 lines
670 B
TypeScript

import Subcommand from "./subcommand.js";
import {Command} from "commander";
import ModManager from "../mod-manager.js";
import Mods from "../mods/mods.js";
export default class UninstallCommand implements Subcommand {
registerCommand(program: Command): void {
program.command("uninstall")
.description("Uninstalls the provided mods")
.argument("<mods...>", "The mods to uninstall (as names or ids)")
.action((mods) => {
ModManager.execute(() => {
for (let mod of mods) {
Mods.uninstall(mod);
}
})
})
}
}