From 89c47277e80ccb18008def4a1b30467baa69afdd Mon Sep 17 00:00:00 2001 From: Hinton Date: Tue, 26 Jan 2021 19:11:36 +0100 Subject: [PATCH] Only change socketRoot on mac --- src/main/nativeMessaging.main.ts | 4 +++- src/proxy/ipc.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/nativeMessaging.main.ts b/src/main/nativeMessaging.main.ts index 40ae0603..48793735 100644 --- a/src/main/nativeMessaging.main.ts +++ b/src/main/nativeMessaging.main.ts @@ -17,7 +17,9 @@ export class NativeMessagingMain { listen() { ipc.config.id = 'bitwarden'; ipc.config.retry = 1500; - ipc.config.socketRoot = path.join(homedir(), 'tmp'); + if (process.platform === 'darwin') { + ipc.config.socketRoot = path.join(homedir(), 'tmp'); + } ipc.serve(() => { ipc.server.on('message', (data: any, socket: any) => { diff --git a/src/proxy/ipc.ts b/src/proxy/ipc.ts index 530d5bb8..ab68efc3 100644 --- a/src/proxy/ipc.ts +++ b/src/proxy/ipc.ts @@ -6,7 +6,9 @@ import * as path from 'path'; ipc.config.id = 'proxy'; ipc.config.retry = 1500; ipc.config.logger = console.warn; // Stdout is used for native messaging -ipc.config.socketRoot = path.join(homedir(), 'tmp'); +if (process.platform === 'darwin') { + ipc.config.socketRoot = path.join(homedir(), 'tmp'); +} export default class IPC { onMessage: (message: object) => void