From e592f0e8bc1ca0ce68a70e7d4d723b15e2b3f00a Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Wed, 18 Oct 2017 19:56:31 -0500 Subject: [PATCH] fix(resources): add resources and make OS dynamic --- app/main.dev.js | 16 ++++------------ package.json | 3 ++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/main.dev.js b/app/main.dev.js index ace2a563..7dcbcafb 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -20,6 +20,7 @@ import { platform } from 'os' import MenuBuilder from './menu' import lnd from './lnd' +const plat = platform() let mainWindow = null let neutrino = null let syncing = false @@ -112,19 +113,12 @@ app.on('ready', async () => { if (!results.length) { // Run a bash script that checks for the LND folder and generates Node.js compatible certs console.log('CHECKING/GENERATING CERTS') - exec(`sh ${path.join(__dirname, '..', 'resources', 'scripts', 'darwin_generate_certs.sh')}`) - // exec(`echo > certs.txt`) - // exec("mkdir -p ~/Library/Application\ Support/Lnd;") - // exec("openssl ecparam -genkey -name prime256v1 -out ~/Library/Application\ Support/Lnd/tls.key") - // exec("openssl req -new -sha256 -key ~/Library/Application\ Support/Lnd/tls.key -out ~/Library/Application\ Support/Lnd/csr.csr -subj '/CN=localhost/O=lnd'") - // exec("openssl req -x509 -sha256 -days 3650 -key ~/Library/Application\ Support/Lnd/tls.key -in ~/Library/Application\ Support/Lnd/csr.csr -out ~/Library/Application\ Support/Lnd/tls.cert") - // exec("rm ~/Library/Application\ Support/Lnd/csr.csr") - + exec(`sh ${path.join(__dirname, '..', 'resources', 'scripts', `${plat}_generate_certs.sh`)}`) // After the certs are generated, it's time to start LND console.log('STARTING LND') - const lndPath = path.join(__dirname, '..', 'resources', 'bin', 'darwin', 'darwin' === 'win32' ? 'lnd.exe' : 'lnd') - console.log('lndPath: ', lndPath) + const lndPath = path.join(__dirname, '..', 'resources', 'bin', plat, plat === 'win32' ? 'lnd.exe' : 'lnd') + neutrino = spawn(lndPath, [ '--bitcoin.active', @@ -139,8 +133,6 @@ app.on('ready', async () => { .on('error', error => console.log(`lnd error: ${error}`)) .on('close', code => console.log(`lnd shutting down ${code}`)) - // exec(`echo > lnd.txt`) - // Let the front end know we have started syncing LND syncing = true diff --git a/package.json b/package.json index 9d6cb61b..d60d8e1e 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,8 @@ "**/resources/bin/linux/lnd", "**/resources/bin/win32/lnd", "**/resources/scripts/*", - "**/resources/cloudbolt.svg" + "**/resources/cloudbolt.svg", + "**/resources/zap_2.svg" ] }, "repository": {