From 652748f9691a1f5c8544348c2589f29d2b859370 Mon Sep 17 00:00:00 2001 From: Jose Esteve Date: Sun, 6 Sep 2020 15:20:38 +0100 Subject: [PATCH] Cli: Resolves #3711: Fix keytar library being loaded up in FreeBSD. (#3712) Issue https://github.com/laurent22/joplin/issues/3711 This patch replaces the 'isLinux' check by a more restrictive version which fixes the false positive in BSD systems. This was causing Joplin not to load due to the lack of X11 in headless mode. --- .../lib/services/keychain/KeychainServiceDriver.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactNativeClient/lib/services/keychain/KeychainServiceDriver.node.ts b/ReactNativeClient/lib/services/keychain/KeychainServiceDriver.node.ts index 6207a5287a..c2b7a8f872 100644 --- a/ReactNativeClient/lib/services/keychain/KeychainServiceDriver.node.ts +++ b/ReactNativeClient/lib/services/keychain/KeychainServiceDriver.node.ts @@ -17,7 +17,7 @@ const { shim } = require('lib/shim.js'); let keytar:any; try { - keytar = shim.isLinux() || shim.isPortable() ? null : require('keytar'); + keytar = (shim.isWindows() || shim.isMac()) && !shim.isPortable() ? require('keytar') : null; } catch (error) { console.error('Cannot load keytar - keychain support will be disabled', error); keytar = null;