be sure that the old version of the repository is removed before copying the new version

This commit is contained in:
tdurieux
2021-04-27 07:40:48 +02:00
parent f58e46fc56
commit b6c4b780b8

View File

@@ -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 });