Skip to content

Commit

Permalink
fix: unlink the outDir twice will report an error (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Feb 23, 2022
1 parent b9b8170 commit 5bd6819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -64,7 +64,7 @@ export async function removeFiles(patterns: string[], dir: string) {
cwd: dir,
absolute: true,
})
await Promise.all(files.map((file) => fs.promises.unlink(file)))
files.forEach((file) => fs.existsSync(file) && fs.unlinkSync(file))
}

export function debouncePromise<T extends unknown[]>(
Expand Down

0 comments on commit 5bd6819

Please sign in to comment.