mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 05:38:09 +02:00
be sure that the old version of the repository is removed before copying the new version
This commit is contained in:
@@ -166,6 +166,9 @@ module.exports.downloadOriginalRepo = async (repoConfig, destination) => {
|
|||||||
await extract(zipPath, { dir: destinationZip });
|
await extract(zipPath, { dir: destinationZip });
|
||||||
|
|
||||||
const folders = await fs.readdir(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);
|
fs.rename(path.join(destinationZip, folders[0]), destination);
|
||||||
await fs.rm(zipPath);
|
await fs.rm(zipPath);
|
||||||
await fs.rm(destinationZip, { recursive: true });
|
await fs.rm(destinationZip, { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user