From 71b7bbf99ad40d6ecd366463bd46ed5a6fae9aa2 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 26 Feb 2019 18:23:33 -0600 Subject: [PATCH] Check EISDIR for Mac when performing mkdir --- packages/ide/test/fs.test.ts | 2 +- packages/ide/test/net.test.ts | 2 +- packages/protocol/src/node/server.ts | 2 +- packages/server/src/modules.ts | 2 +- packages/server/src/vscode/sharedProcess.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ide/test/fs.test.ts b/packages/ide/test/fs.test.ts index e49afab64..a4eb1bdfd 100644 --- a/packages/ide/test/fs.test.ts +++ b/packages/ide/test/fs.test.ts @@ -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; } } diff --git a/packages/ide/test/net.test.ts b/packages/ide/test/net.test.ts index 964b4ffe0..9922a10ce 100644 --- a/packages/ide/test/net.test.ts +++ b/packages/ide/test/net.test.ts @@ -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; } } diff --git a/packages/protocol/src/node/server.ts b/packages/protocol/src/node/server.ts index 8464a6ac4..812ebf0c9 100644 --- a/packages/protocol/src/node/server.ts +++ b/packages/protocol/src/node/server.ts @@ -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; } } diff --git a/packages/server/src/modules.ts b/packages/server/src/modules.ts index 6d1bc273b..879d779d2 100644 --- a/packages/server/src/modules.ts +++ b/packages/server/src/modules.ts @@ -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; } } diff --git a/packages/server/src/vscode/sharedProcess.ts b/packages/server/src/vscode/sharedProcess.ts index 94823061a..3b9f3f580 100644 --- a/packages/server/src/vscode/sharedProcess.ts +++ b/packages/server/src/vscode/sharedProcess.ts @@ -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; } }