Skip to content

Commit 9e60539

Browse files
author
Ben Newman
committed
Fall back to async for EPERM errors in files.rm_recursive.
Previously, the async fallback was only used in case of ENOTEMPTY errors, but Windows appears to throw temporary EPERM errors as well. If the errors are actually robust/non-temporary, the async version will fail, too. Should help with meteor#9540.
1 parent d78bed0 commit 9e60539

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/fs/files.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ files.rm_recursive = Profile("files.rm_recursive", (path) => {
310310
try {
311311
rimraf.sync(files.convertToOSPath(path));
312312
} catch (e) {
313-
if (e.code === "ENOTEMPTY" && canYield()) {
313+
if ((e.code === "ENOTEMPTY" ||
314+
e.code === "EPERM") &&
315+
canYield()) {
314316
files.rm_recursive_async(path).await();
315317
return;
316318
}

0 commit comments

Comments
 (0)