Added downloading mods from Modrinth

This commit is contained in:
Kallum Jones
2022-08-03 15:00:36 +01:00
parent 7774386385
commit 765920f80c
14 changed files with 681 additions and 11 deletions

View File

@ -0,0 +1,19 @@
import { Command } from "commander";
import Subcommand from "./subcommand.js"
import ModManager from "../mod-manager.js";
import Mods from "../mods/mods.js";
export default class InstallCommand implements Subcommand {
registerCommand(program: Command): void {
program.command("install")
.description("Installs the provided mods")
.argument("<mods...>", "The mods to install")
.action((mods) => {
ModManager.execute(async () => {
for (const mod of mods) {
await Mods.install(mod);
}
})
});
}
}

View File

@ -1,6 +1,5 @@
import { Command } from "commander";
export default abstract class Subcommand {
abstract registerCommand(program: Command): void;
abstract execute(): void;
export default interface Subcommand {
registerCommand(program: Command): void;
}