From 2fc58c4e2b32a0b94958e58e4b869b97b286c326 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me>
Date: Thu, 18 Jan 2024 17:08:15 +0100
Subject: [PATCH] CI/CD => Restore version replacement from pipeline

---
 AssignmentChecker/.gitlab-ci/01_functions.yml | 2 +-
 AssignmentChecker/src/app.ts                  | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/AssignmentChecker/.gitlab-ci/01_functions.yml b/AssignmentChecker/.gitlab-ci/01_functions.yml
index 9a7581a..3186774 100644
--- a/AssignmentChecker/.gitlab-ci/01_functions.yml
+++ b/AssignmentChecker/.gitlab-ci/01_functions.yml
@@ -51,7 +51,7 @@
         # Decrypt env vars for production
         - apk add npm sed
         - cd $PROJECT_FOLDER
-        # - sed -i -r "s/\{\{VERSION\}\}/${VERSION}/g" src/app.ts # Not needed anymore
+        - sed -i -r "s/\{\{VERSION\}\}/${VERSION}/g" src/app.ts # Needed for have the -dev ou -test suffix in the version
         - |
             if [[ $CI_COMMIT_REF_PROTECTED == "true" || $IS_TEST == true ]]; then
                 echo "Decrypt production env vars"
diff --git a/AssignmentChecker/src/app.ts b/AssignmentChecker/src/app.ts
index 76dc2c8..ce2def4 100644
--- a/AssignmentChecker/src/app.ts
+++ b/AssignmentChecker/src/app.ts
@@ -19,13 +19,12 @@ import Styles                        from './types/Style';
 import HttpManager                   from './managers/HttpManager';
 import Config                        from './config/Config';
 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}})`));
 
     const assignmentValidator = new AssignmentValidator(Config.folders.project);
 
-- 
GitLab