Skip to content
Snippets Groups Projects
Commit c10c7050 authored by michael.minelli's avatar michael.minelli
Browse files

Fix update messages

parent ef163889
No related branches found
No related tags found
No related merge requests found
Pipeline #30238 passed
......@@ -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',
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment