From f1d3f7bf1d072c0b6355e4d6b4acacc8edddf5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.swiss> Date: Wed, 2 Apr 2025 17:02:56 +0200 Subject: [PATCH] Sonar => Resolve issues --- .../commander/exercise/subcommands/ExerciseResultCommand.ts | 4 ++-- NodeApp/src/helpers/Dojo/ExerciseHelper.ts | 2 +- NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts | 4 ++-- NodeApp/src/shared | 2 +- NodeApp/src/sharedByClients | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NodeApp/src/commander/exercise/subcommands/ExerciseResultCommand.ts b/NodeApp/src/commander/exercise/subcommands/ExerciseResultCommand.ts index 687fab7..a7d3441 100644 --- a/NodeApp/src/commander/exercise/subcommands/ExerciseResultCommand.ts +++ b/NodeApp/src/commander/exercise/subcommands/ExerciseResultCommand.ts @@ -23,7 +23,7 @@ class ExerciseResultCommand extends CommanderCommand { try { const exerciseId = this.extractExerciseId(idOrLink); - // console.log('Exercise ID:', exerciseId); + spinner.info(`Fetching results for exercise with ID: ${ exerciseId }`); const results = await DojoBackendManager.getExerciseResults(exerciseId); @@ -59,7 +59,7 @@ class ExerciseResultCommand extends CommanderCommand { return idOrLink; } else { const lastUnderscoreIndex = idOrLink.lastIndexOf('_'); - // console.log('Last underscore index:', lastUnderscoreIndex); + if ( lastUnderscoreIndex !== -1 ) { // -1 = pas de underscore trouvé return idOrLink.substring(lastUnderscoreIndex + 1); // Extrait la sous-chaîne après le dernier underscore dans idOrLink } else { diff --git a/NodeApp/src/helpers/Dojo/ExerciseHelper.ts b/NodeApp/src/helpers/Dojo/ExerciseHelper.ts index 5871b47..111113b 100644 --- a/NodeApp/src/helpers/Dojo/ExerciseHelper.ts +++ b/NodeApp/src/helpers/Dojo/ExerciseHelper.ts @@ -18,7 +18,7 @@ class ExerciseHelper { return; } - let path: string | boolean = './'; + let path: string | boolean; if ( providedPath === undefined ) { path = (await inquirer.prompt([ { type : 'input', diff --git a/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts b/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts index 0503c66..b282ec9 100644 --- a/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts +++ b/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts @@ -195,7 +195,7 @@ class ExerciseRunHelper { composeFileOverride = [ composeOverridePath ]; } - this.exerciseDockerCompose = new ExerciseDockerCompose(this.projectName, this.assignmentFile, this.localExercisePath, composeFileOverride); + this.exerciseDockerCompose = new ExerciseDockerCompose(this.projectName, this.assignmentFile, this.localExercisePath, true, composeFileOverride); try { await new Promise<void>((resolve, reject) => { @@ -209,7 +209,7 @@ class ExerciseRunHelper { this.exerciseDockerCompose.events.on('finished', (success: boolean) => success ? resolve() : reject()); - this.exerciseDockerCompose.run(true); + this.exerciseDockerCompose.run(); }); } catch ( error ) { /* empty */ } diff --git a/NodeApp/src/shared b/NodeApp/src/shared index 937081e..517dad7 160000 --- a/NodeApp/src/shared +++ b/NodeApp/src/shared @@ -1 +1 @@ -Subproject commit 937081e68f6127b669daca30e57c43e73b9c96c9 +Subproject commit 517dad7434944ac046b5680c0f24af08b17cf460 diff --git a/NodeApp/src/sharedByClients b/NodeApp/src/sharedByClients index 59308a7..1611576 160000 --- a/NodeApp/src/sharedByClients +++ b/NodeApp/src/sharedByClients @@ -1 +1 @@ -Subproject commit 59308a719fdee1a2025e90a18774d56fc6d11d9b +Subproject commit 16115763d4ab5849c3d422b3a597f3d11965cd58 -- GitLab