Merge pull request #2344 from lbryio/fix-lbrynet

Fix lbrynet not starting
This commit is contained in:
Shawn K 2019-03-15 23:07:14 -05:00 committed by GitHub
commit 3cb84c6df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

View file

@ -45,7 +45,7 @@
"electron-log": "^2.2.12",
"electron-updater": "^4.0.6",
"express": "^4.16.4",
"keytar": "4.4.1"
"keytar": "^4.4.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
@ -100,7 +100,6 @@
"hast-util-sanitize": "^1.1.2",
"husky": "^0.14.3",
"json-loader": "^0.5.4",
"keytar": "4.4.1",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#2a7e05940f892f104428eeb37bd1f178da811a09",
"lbryinc": "lbryio/lbryinc#351d0a08806b0f770b50066b61a806171f6424d4",

View file

@ -4,7 +4,9 @@ import { spawn, execSync } from 'child_process';
import { Lbry } from 'lbry-redux';
export default class Daemon {
static path = process.env.LBRY_DAEMON || path.join(__static, 'lbrynet');
static path = process.env.LBRY_DAEMON || (
process.env.NODE_ENV === 'production' ? path.join(process.resourcesPath, 'static', 'lbrynet') : path.join(__static, 'lbrynet')
);
subprocess;
handlers;

View file

@ -70,4 +70,11 @@ mainInstance.waitUntilValid(() => {
child.stdout.on('data', (data) => {
console.log(data.toString());
});
process.on('SIGINT', function() {
console.log('Killing threads...');
child.kill('SIGINT');
process.exit();
});
});

View file

@ -60,7 +60,10 @@ if (process.env.NODE_ENV === 'production') {
const nodeExternals = require('webpack-node-externals');
// Apply dev overrides
mainConfig = merge(mainConfig, {
externals: [nodeExternals()],
externals: {
keytar: 'require("keytar")',
electron: 'require("electron")',
},
});
}

View file

@ -5982,7 +5982,7 @@ kebab-case@^1.0.0:
resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb"
integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes=
keytar@4.4.1:
keytar@^4.4.1:
version "4.4.1"
resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.1.tgz#156af8a9b016bf118ee9948b02418c81d760a5ba"
integrity sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==