From f7758680d1bcdcff331311d2b8cc2a74970f09a6 Mon Sep 17 00:00:00 2001 From: Kallum Jones Date: Sun, 7 Aug 2022 21:14:12 +0100 Subject: [PATCH] Changed red x to info symbol when mods are already at the latest version --- src/commands/upgrade_command.ts | 2 +- src/mod-manager.ts | 4 ++-- src/mods/mods.ts | 2 +- src/util/print_utils.ts | 8 ++++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/commands/upgrade_command.ts b/src/commands/upgrade_command.ts index 92bddf2..d6e52ba 100644 --- a/src/commands/upgrade_command.ts +++ b/src/commands/upgrade_command.ts @@ -3,7 +3,7 @@ import {Command} from "commander"; import ModManager from "../mod-manager.js"; import Mods from "../mods/mods.js"; -export default class UpgradeCommand implements Subcommand { +export default class UpdateCommand implements Subcommand { registerCommand(program: Command): void { program.command("update") .description("Checks for and updates mods that have a newer available version") diff --git a/src/mod-manager.ts b/src/mod-manager.ts index f20432d..b35a6f1 100644 --- a/src/mod-manager.ts +++ b/src/mod-manager.ts @@ -11,7 +11,7 @@ import {ListCommand} from "./commands/list_command.js"; import UninstallCommand from "./commands/uninstall_command.js"; import EssentialCommand from "./commands/essential_command.js"; import {readFileSync, unlinkSync} from "fs"; -import UpgradeCommand from "./commands/upgrade_command.js"; +import UpdateCommand from "./commands/upgrade_command.js"; import MigratePossibleCommand from "./commands/migrate_possible.js"; @@ -26,7 +26,7 @@ export default class ModManager { new ListCommand(), new UninstallCommand(), new EssentialCommand(), - new UpgradeCommand(), + new UpdateCommand(), new MigratePossibleCommand() ]; diff --git a/src/mods/mods.ts b/src/mods/mods.ts index dbb97b4..3b9fe10 100644 --- a/src/mods/mods.ts +++ b/src/mods/mods.ts @@ -194,7 +194,7 @@ export default class Mods { throw new ModNotFoundError("There is no newer version available."); } } catch (e) { - spinner.error(`${mod.name} already has the latest version installed!`) + spinner.info(`${mod.name} already has the latest version installed!`) } } } diff --git a/src/util/print_utils.ts b/src/util/print_utils.ts index 80982c0..577ec06 100644 --- a/src/util/print_utils.ts +++ b/src/util/print_utils.ts @@ -39,6 +39,14 @@ export default class PrintUtils { this.spinner.succeed(print); } + public warn(print: string) { + this.spinner.warn(print); + } + + public info(print: string) { + this.spinner.info(`ℹ️ ${print}`); + } + public updateText(text: string) { this.spinner.start(text); }