From c10c70503e45cd202ada891beec7659bbd2f941b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.me> Date: Wed, 13 Mar 2024 12:18:33 +0100 Subject: [PATCH] Fix update messages --- NodeApp/src/commander/CommanderApp.ts | 10 ++++++---- NodeApp/src/managers/HttpManager.ts | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NodeApp/src/commander/CommanderApp.ts b/NodeApp/src/commander/CommanderApp.ts index fa4460e..56d33f5 100644 --- a/NodeApp/src/commander/CommanderApp.ts +++ b/NodeApp/src/commander/CommanderApp.ts @@ -12,6 +12,7 @@ import CompletionCommand from './completion/CompletionCommand'; import AuthCommand from './auth/AuthCommand'; import SessionCommand from './auth/SessionCommand'; import UpgradeCommand from './UpgradeCommand'; +import TextStyle from '../types/TextStyle'; class CommanderApp { @@ -78,8 +79,8 @@ class CommanderApp { private warnDevelopmentVersion() { if ( !SharedConfig.production ) { console.log(boxen(`This is a development (unstable) version of the DojoCLI. -If you want to use the stable version, please install the package from the following url: -https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, { +If you want to use the stable version, please execute this command: +${ TextStyle.CODE(' dojo upgrade ') }`, { title : 'Warning', titleAlignment: 'center', borderColor : 'red', @@ -96,8 +97,9 @@ https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, { const latestDojoCliVersion = stateConfigFile.getParam('latestDojoCliVersion') as string | null || '0.0.0'; const latestDojoCliVersionNotification = stateConfigFile.getParam('latestDojoCliVersionNotification') as number | null || 0; if ( semver.lt(version, latestDojoCliVersion) && (new Date()).getTime() - latestDojoCliVersionNotification >= Config.versionUpdateInformationPeriodHours * 60 * 60 * 1000 ) { - console.log(boxen(`The ${ latestDojoCliVersion } version of the DojoCLI is available: -https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, { + console.log(boxen(`The ${ latestDojoCliVersion } version of the DojoCLI is available. +You can upgrade the DojoCLI by executing this command: +${ TextStyle.CODE(' dojo upgrade ') }`, { title : 'Information', titleAlignment: 'center', borderColor : 'blue', diff --git a/NodeApp/src/managers/HttpManager.ts b/NodeApp/src/managers/HttpManager.ts index 3846275..a28fc21 100644 --- a/NodeApp/src/managers/HttpManager.ts +++ b/NodeApp/src/managers/HttpManager.ts @@ -7,9 +7,9 @@ import { version } from '../c import DojoBackendResponse from '../shared/types/Dojo/DojoBackendResponse'; import DojoStatusCode from '../shared/types/Dojo/DojoStatusCode'; import boxen from 'boxen'; -import Config from '../config/Config'; import SharedConfig from '../shared/config/SharedConfig'; import { stateConfigFile } from '../config/ConfigFiles'; +import TextStyle from '../types/TextStyle'; class HttpManager { @@ -72,7 +72,7 @@ class HttpManager { this.requestError('Client not recognized by the server. Please contact the administrator.'); break; case DojoStatusCode.CLIENT_VERSION_NOT_SUPPORTED: - this.requestError(`CLI version not anymore supported by the server. Please update the CLI.\nYou can download the latest stable version on this page:\n${ Config.gitlab.cliReleasePage }`); + this.requestError(`CLI version not anymore supported by the server. Please update the CLI by executing this command:\n${ TextStyle.CODE(' dojo upgrade ') }`); break; default: break; -- GitLab