mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2025-07-11 21:49:43 -04:00
Added downloading mods from Modrinth
This commit is contained in:
19
src/commands/install_command.ts
Normal file
19
src/commands/install_command.ts
Normal 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);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
Reference in New Issue
Block a user