Skip to content

Commit

Permalink
build: clear existing directory
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Aug 25, 2021
1 parent bc5da06 commit 5b5e0c8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ async function validate(version, patchFile) {

const code = Math.floor(Math.random() * 0x100000000).toString(16).padStart(8, `0`);
const tmpDir = path.join(TMP_DIR, `${code}`);
if (fs.existsSync(tmpDir)) {
console.log(`Clearing existing folder`);
await fs.promises.rm(tmpDir, {force: true, recursive: true});
}

await fs.promises.mkdir(tmpDir, {recursive: true});

let patch = await fs.promises.readFile(patchFile, `utf8`);
Expand Down

0 comments on commit 5b5e0c8

Please sign in to comment.