mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00: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 });
|
||||
|
||||
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 });
|
||||
|
||||
Reference in New Issue
Block a user