diff --git a/src/commands/init_command.ts b/src/commands/init_command.ts index 72c40ed..adab411 100644 --- a/src/commands/init_command.ts +++ b/src/commands/init_command.ts @@ -5,7 +5,7 @@ import Subcommand from "./subcommand.js"; export default class InitCommand implements Subcommand { registerCommand(program: Command) { program.command("init") - .description("Initialises mod manager") + .description("Initialises mod manager. Execute in the root of the server directory you want to use Mod Manager in") .action(async () => { await Initialiser.initialise(); }); diff --git a/src/mod-manager.ts b/src/mod-manager.ts index ac4edad..5241250 100644 --- a/src/mod-manager.ts +++ b/src/mod-manager.ts @@ -18,6 +18,7 @@ import ModrinthSource from "./mods/sources/modrinth_source.js"; import Mods from "./mods/mods.js"; import {CurseforgeSource} from "./mods/sources/curseforge_source.js"; import MinecraftUtils from "./util/minecraft_utils.js"; +import chalk from "chalk"; export default class ModManager { public static logger: Logger | null = null; @@ -46,10 +47,14 @@ export default class ModManager { this.logger = ModManager.createLogger(); } + const version = Initialiser.isInitialised() ? + await MinecraftUtils.getCurrentMinecraftVersion() : + chalk.redBright("Not Initialised. See `mod-manager init -h` for more details!") + this.program .name('mod-manager') .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"); + .version(`Minecraft server version: ${version}`, "-v, --version", "Reports the version of the Minecraft server"); for (const command of this.subcommands) {