From d2da386daef14b376882f6d4aae366a36c6b88da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Thu, 18 Jan 2024 13:54:57 +0100 Subject: [PATCH] App => Code improvement --- ExerciseChecker/src/app.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ExerciseChecker/src/app.ts b/ExerciseChecker/src/app.ts index 79e07d2..791025b 100644 --- a/ExerciseChecker/src/app.ts +++ b/ExerciseChecker/src/app.ts @@ -15,7 +15,6 @@ require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST import ClientsSharedConfig from './sharedByClients/config/ClientsSharedConfig'; import Styles from './types/Style'; -import Icon from './sharedByClients/types/Icon'; import RecursiveFilesStats from './shared/helpers/recursiveFilesStats/RecursiveFilesStats'; import Toolbox from './shared/helpers/Toolbox'; import ExerciseCheckerError from './shared/types/Dojo/ExerciseCheckerError'; @@ -28,12 +27,14 @@ import ExerciseDockerCompose from './sharedByClients/helpers/Dojo import ExerciseResultsSanitizerAndValidator from './sharedByClients/helpers/Dojo/ExerciseResultsSanitizerAndValidator'; import ExerciseAssignment from './sharedByClients/models/ExerciseAssignment'; import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo/ClientsSharedExerciseHelper'; +import Icon from './shared/types/Icon'; +import { version } from './config/Version'; (async () => { HttpManager.registerAxiosInterceptor(); - console.log(Styles.APP_NAME(`${ Config.appName } (version {{VERSION}})`)); + console.log(Styles.APP_NAME(`${ Config.appName } (version ${ version })`)); let exerciseAssignment: ExerciseAssignment | undefined; let exerciseDockerCompose: ExerciseDockerCompose; @@ -48,7 +49,7 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo - Download immutables files (maybe throw or show an error if the files have been modified ?) */ { - console.log(Styles.INFO(`${ Icon.INFO }️ Checking the exercise's assignment and his immutable files`)); + console.log(Styles.INFO(`${ Icon.INFO }️Checking the exercise's assignment and his immutable files`)); exerciseAssignment = await DojoBackendManager.getExerciseAssignment(); if ( !exerciseAssignment ) { console.error(Styles.ERROR(`${ Icon.ERROR } Error while getting the exercise's assignment`)); @@ -85,11 +86,11 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo try { await new Promise<void>((resolve, reject) => { - exerciseDockerCompose.events.on('step', (name: string, message: string) => { + exerciseDockerCompose.events.on('step', (_name: string, message: string) => { console.log(Styles.INFO(`${ Icon.INFO } ${ message }`)); }); - exerciseDockerCompose.events.on('endStep', (stepName: string, message: string, error: boolean) => { + exerciseDockerCompose.events.on('endStep', (_stepName: string, message: string, error: boolean) => { if ( error ) { console.error(Styles.ERROR(`${ Icon.ERROR } ${ message }`)); } @@ -119,11 +120,11 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo try { await new Promise<void>((resolve) => { - exerciseResultsValidation.events.on('step', (name: string, message: string) => { + exerciseResultsValidation.events.on('step', (_name: string, message: string) => { console.log(Styles.INFO(`${ Icon.INFO } ${ message }`)); }); - exerciseResultsValidation.events.on('endStep', (stepName: string, message: string, error: boolean) => { + exerciseResultsValidation.events.on('endStep', (_stepName: string, message: string, error: boolean) => { if ( error ) { console.error(Styles.ERROR(`${ Icon.ERROR } ${ message }`)); } -- GitLab