mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2024-11-21 13:38:21 -05:00
Add --version flag
This commit is contained in:
parent
47838309af
commit
5868bdc066
@ -17,6 +17,7 @@ import MigrateCommand from "./commands/migrate_command.js";
|
|||||||
import ModrinthSource from "./mods/sources/modrinth_source.js";
|
import ModrinthSource from "./mods/sources/modrinth_source.js";
|
||||||
import Mods from "./mods/mods.js";
|
import Mods from "./mods/mods.js";
|
||||||
import {CurseforgeSource} from "./mods/sources/curseforge_source.js";
|
import {CurseforgeSource} from "./mods/sources/curseforge_source.js";
|
||||||
|
import MinecraftUtils from "./util/minecraft_utils.js";
|
||||||
|
|
||||||
export default class ModManager {
|
export default class ModManager {
|
||||||
public static logger: Logger | null = null;
|
public static logger: Logger | null = null;
|
||||||
@ -40,14 +41,16 @@ export default class ModManager {
|
|||||||
new MigrateCommand()
|
new MigrateCommand()
|
||||||
];
|
];
|
||||||
|
|
||||||
static init() {
|
static async init() {
|
||||||
if (Initialiser.isInitialised()) {
|
if (Initialiser.isInitialised()) {
|
||||||
this.logger = ModManager.createLogger();
|
this.logger = ModManager.createLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.program
|
this.program
|
||||||
.name('mod-manager')
|
.name('mod-manager')
|
||||||
.description('A package (mod) manager for Fabric Minecraft Servers');
|
.description('A package (mod) manager for Fabric Minecraft Servers')
|
||||||
|
.version(`Minecraft server version: ${await MinecraftUtils.getCurrentMinecraftVersion()}`, "-v, --version", "Reports the version of the Minecraft server");
|
||||||
|
|
||||||
|
|
||||||
for (const command of this.subcommands) {
|
for (const command of this.subcommands) {
|
||||||
command.registerCommand(this.program);
|
command.registerCommand(this.program);
|
||||||
@ -58,6 +61,7 @@ export default class ModManager {
|
|||||||
|
|
||||||
this.program.showSuggestionAfterError();
|
this.program.showSuggestionAfterError();
|
||||||
this.program.showHelpAfterError();
|
this.program.showHelpAfterError();
|
||||||
|
|
||||||
this.program.parse();
|
this.program.parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user