Check EISDIR for Mac when performing mkdir

This commit is contained in:
Asher 2019-02-26 18:23:33 -06:00
parent d556e110cb
commit 71b7bbf99a
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
5 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ describe("fs", () => {
try {
await util.promisify(nativeFs.mkdir)(path.dirname(coderDir));
} catch (error) {
if (error.code !== "EEXIST") {
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
throw error;
}
}

View File

@ -19,7 +19,7 @@ describe("net", () => {
try {
await util.promisify(fs.mkdir)(path.dirname(coderDir));
} catch (error) {
if (error.code !== "EEXIST") {
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
throw error;
}
}

View File

@ -51,7 +51,7 @@ export class Server {
try {
await promisify(mkdir)(dir);
} catch (error) {
if (error.code !== "EEXIST") {
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
throw error;
}
}

View File

@ -13,7 +13,7 @@ export const setup = (dataDirectory: string): void => {
try {
fs.mkdirSync(currentDir);
} catch (ex) {
if (ex.code !== "EEXIST") {
if (ex.code !== "EEXIST" && ex.code !== "EISDIR") {
throw ex;
}
}

View File

@ -54,7 +54,7 @@ export class SharedProcess {
try {
fs.mkdirSync(dir);
} catch (ex) {
if (ex.code !== "EEXIST") {
if (ex.code !== "EEXIST" && ex.code !== "EISDIR") {
throw ex;
}
}