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

@ -1,25 +1,31 @@
#!/usr/bin/env node
import { Command } from "commander";
import InitCommand from "./commands/init_command.js";
import InstallCommand from "./commands/install_command.js";
import Subcommand from "./commands/subcommand.js";
import Initialiser from "./util/initialiser.js";
import PrintUtils from "./util/print_utils.js";
//import PrettyError from "pretty-error";
export default class ModManager {
private static program: Command = new Command();
private static subcommands: Array<Subcommand> = [
new InitCommand()
new InitCommand(),
new InstallCommand()
];
static init() {
//const pe = new PrettyError();
//pe.start();
this.program
.name('mod-manager')
.description('A package (mod) manager for Fabric Minecraft Servers');
this.subcommands.forEach(command => {
command.registerCommand(ModManager.program);
});
for (const command of this.subcommands) {
command.registerCommand(this.program);
}
this.program.parse();
}
@ -30,10 +36,9 @@ export default class ModManager {
} else {
PrintUtils.error("Mod Manager is not initialised");
}
}
}
}
ModManager.init();