Skip to content

Commit

Permalink
Retry directory deletion to avoid Windows file locking issues.
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Eisenberg <[email protected]>
  • Loading branch information
chrisgavin and aeisenberg authored Feb 28, 2022
1 parent cd30cdb commit 02893b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export async function runFinalize(

// After switching to Node16, this entire block can be replaced with `await fs.promises.rm(outputDir, { recursive: true, force: true });`.
try {
await fs.promises.rmdir(outputDir, { recursive: true });
await fs.promises.rmdir(outputDir, { recursive: true, maxRetries: 5, retryDelay: 2000 });
} catch (error: any) {
if (error?.code !== "ENOENT") {
throw error;
Expand Down

0 comments on commit 02893b4

Please sign in to comment.