mirror of https://git.tuxpa.in/a/code-server.git
Check EISDIR for Mac when performing mkdir
This commit is contained in:
parent
d556e110cb
commit
71b7bbf99a
|
@ -25,7 +25,7 @@ describe("fs", () => {
|
||||||
try {
|
try {
|
||||||
await util.promisify(nativeFs.mkdir)(path.dirname(coderDir));
|
await util.promisify(nativeFs.mkdir)(path.dirname(coderDir));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code !== "EEXIST") {
|
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe("net", () => {
|
||||||
try {
|
try {
|
||||||
await util.promisify(fs.mkdir)(path.dirname(coderDir));
|
await util.promisify(fs.mkdir)(path.dirname(coderDir));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code !== "EEXIST") {
|
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ export class Server {
|
||||||
try {
|
try {
|
||||||
await promisify(mkdir)(dir);
|
await promisify(mkdir)(dir);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code !== "EEXIST") {
|
if (error.code !== "EEXIST" && error.code !== "EISDIR") {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const setup = (dataDirectory: string): void => {
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(currentDir);
|
fs.mkdirSync(currentDir);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
if (ex.code !== "EEXIST") {
|
if (ex.code !== "EEXIST" && ex.code !== "EISDIR") {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ export class SharedProcess {
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(dir);
|
fs.mkdirSync(dir);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
if (ex.code !== "EEXIST") {
|
if (ex.code !== "EEXIST" && ex.code !== "EISDIR") {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue