From 21f0f3a238e1942fded6772b18574de993a3f226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Fri, 11 Aug 2023 23:20:45 +0200 Subject: [PATCH] Config => Add some env var needed by exercice local execution --- NodeApp/src/config/Config.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/NodeApp/src/config/Config.ts b/NodeApp/src/config/Config.ts index f19ec8d..c384a41 100644 --- a/NodeApp/src/config/Config.ts +++ b/NodeApp/src/config/Config.ts @@ -6,11 +6,35 @@ class Config { folder: string; file: string; }; + public readonly folders: { + defaultLocalExercice: string + }; + + public enonce: { + filename: string + }; + + public readonly exercice: { + neededFiles: Array<string> + }; + constructor() { this.localConfig = { folder: getAppDataPath('DojoCLI'), file : process.env.LOCAL_CONFIG_FILE || '' }; + + this.folders = { + defaultLocalExercice: process.env.LOCAL_EXERCICE_DEFAULT_FOLDER || './' + }; + + this.enonce = { + filename: process.env.ENONCE_FILENAME || '' + }; + + this.exercice = { + neededFiles: JSON.parse(process.env.EXERCICE_NEEDED_FILES || '[]') + }; } } -- GitLab