Browse Source

fix(resources): add resources and make OS dynamic

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
e592f0e8bc
  1. 16
      app/main.dev.js
  2. 3
      package.json

16
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

3
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": {

Loading…
Cancel
Save