fixed macos socket

This commit is contained in:
antelle 2021-04-15 23:46:34 +02:00
parent 566e2fb35d
commit 27143e2663
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 9 additions and 2 deletions

View File

@ -303,9 +303,16 @@ const Launcher = {
},
prepareBrowserExtensionSocket(done) {
if (process.platform === 'darwin') {
const dir = this.req('path').dirname(this.getBrowserExtensionSocketName());
const sockName = this.getBrowserExtensionSocketName();
const fs = this.req('fs');
fs.mkdir(dir, () => done());
fs.access(sockName, fs.constants.F_OK, (err) => {
if (err) {
const dir = this.req('path').dirname(sockName);
fs.mkdir(dir, () => done());
} else {
fs.unlink(sockName, () => done());
}
});
} else if (process.platform === 'win32') {
done();
} else {