mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
Changed error code to EAGAIN
This commit is contained in:
parent
57a3725f43
commit
7ddbba67c2
@ -53,11 +53,11 @@ function rmdirSyncRecursive(dir, force) {
|
||||
while (true) {
|
||||
try {
|
||||
result = fs.rmdirSync(dir);
|
||||
if (fs.existsSync(dir)) throw { code: "EEXIST" }
|
||||
if (fs.existsSync(dir)) throw { code: "EAGAIN" }
|
||||
break;
|
||||
} catch(er) {
|
||||
// In addition to error codes, also check if the directory still exists and loop again if true
|
||||
if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EEXIST")) {
|
||||
if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) {
|
||||
if (Date.now() - start > 1000) throw er;
|
||||
} else if (er.code === "ENOENT") {
|
||||
// Directory did not exist, deletion was successful
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user