From 052b450337729dc8526b4727239209f8cc2faffb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me>
Date: Wed, 2 Aug 2023 23:50:40 +0200
Subject: [PATCH] Replace move function by a copy one

---
 ExerciceChecker/src/app.ts | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ExerciceChecker/src/app.ts b/ExerciceChecker/src/app.ts
index 5341b74..49b2a6a 100644
--- a/ExerciceChecker/src/app.ts
+++ b/ExerciceChecker/src/app.ts
@@ -34,7 +34,7 @@ import Config               from './config/Config';
     }
 
     exerciceEnonce.immutable.forEach(immutableFile => {
-        const filePath = `${ Config.folders.project }/${ immutableFile.file_path }`.replace(/\/\//g, '/');
+        const filePath = path.join(Config.folders.project, immutableFile.file_path);
         fs.mkdirSync(path.dirname(filePath), { recursive: true });
         fs.writeFileSync(filePath, immutableFile.content, { encoding: 'base64' });
     });
@@ -100,7 +100,10 @@ import Config               from './config/Config';
 
 
     // Step 8: Exit with container exit code
-    fs.moveSync(Config.folders.resultsVolume, Config.folders.artifacts, { overwrite: true });
+    fs.copySync(Config.folders.resultsVolume, Config.folders.artifacts, {
+        overwrite         : true,
+        preserveTimestamps: true
+    });
 
     process.exit(containerExitStatus[0]);
 })();
-- 
GitLab