From bd6c0c2a5633927087166f1eaab21e8871441b11 Mon Sep 17 00:00:00 2001 From: emad-salah Date: Mon, 10 Feb 2020 22:33:47 +0100 Subject: [PATCH] Fixed __dirname value --- config/defaults.js | 4 +++- services/auth/auth.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/defaults.js b/config/defaults.js index b6be4d6d..3e49dadb 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -2,6 +2,8 @@ const os = require("os"); const path = require("path"); const platform = os.platform(); const homeDir = os.homedir(); +// @ts-ignore +const rootFolder = process.resourcesPath || __dirname const getLndDirectory = () => { if (platform === "darwin") { @@ -35,7 +37,7 @@ module.exports = (mainnet = false) => { sessionMaxAge: 300000, lndAddress: "127.0.0.1:9735", maxNumRoutesToQuery: 20, - lndProto: parsePath(`${__dirname}/rpc.proto`), + lndProto: parsePath(`${rootFolder}/rpc.proto`), lndHost: "localhost:10009", lndCertPath: parsePath(`${lndDirectory}/tls.cert`), macaroonPath: parsePath( diff --git a/services/auth/auth.js b/services/auth/auth.js index 4b019d82..f2abe92b 100644 --- a/services/auth/auth.js +++ b/services/auth/auth.js @@ -8,7 +8,9 @@ const jsonfile = require('jsonfile') const path = require('path') const logger = require('winston') const FS = require('../../utils/fs') -const secretsFilePath = path.resolve(__dirname, 'secrets.json') + +const rootFolder = process.resourcesPath || __dirname +const secretsFilePath = path.resolve(rootFolder, 'secrets.json') class Auth { verifySecretsFile = async () => {