From b6c4b780b80e7e3735ba6ba1e4c8cbe618dfbd57 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 27 Apr 2021 07:40:48 +0200 Subject: [PATCH] be sure that the old version of the repository is removed before copying the new version --- utils/repository.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/repository.js b/utils/repository.js index 1b9f72e..4de81cd 100644 --- a/utils/repository.js +++ b/utils/repository.js @@ -166,6 +166,9 @@ module.exports.downloadOriginalRepo = async (repoConfig, destination) => { await extract(zipPath, { dir: destinationZip }); const folders = await fs.readdir(destinationZip); + if (ofs.existsSync(destination)) { + await fs.rm(destination, {force: true, recursive: true}) + } fs.rename(path.join(destinationZip, folders[0]), destination); await fs.rm(zipPath); await fs.rm(destinationZip, { recursive: true });