From 7952c283efc3ed4bd9e2510ae2bf66e40cc50b4a Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Thu, 29 Mar 2018 23:38:03 +0300 Subject: [PATCH] fix(linux): 32bit linux builds #21 --- package.json | 24 +++++++++++++++++++++--- src/background/electronAppPath.js | 12 ++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 727b7a1..9026e17 100644 --- a/package.json +++ b/package.json @@ -59,9 +59,27 @@ "linux": { "category": "Network", "target": [ - "AppImage", - "rpm", - "deb" + { + "target": "AppImage", + "arch": [ + "x64", + "ia32" + ] + }, + { + "target": "rpm", + "arch": [ + "x64", + "ia32" + ] + }, + { + "target": "deb", + "arch": [ + "x64", + "ia32" + ] + } ], "extraFiles": [ { diff --git a/src/background/electronAppPath.js b/src/background/electronAppPath.js index 476f403..51e0227 100644 --- a/src/background/electronAppPath.js +++ b/src/background/electronAppPath.js @@ -26,10 +26,18 @@ export default (app) => { return fs.realpathSync(__dirname) + `/${app}` } + if (fs.existsSync(fs.realpathSync(__dirname) + `/${process.arch}/${app}`)) { + return fs.realpathSync(__dirname) + `/${process.arch}/${app}` + } + if (fs.existsSync(fs.realpathSync(path.join(__dirname, '/../../..')) + `/${app}`)) { return fs.realpathSync(path.join(__dirname, '/../../..')) + `/${app}` } + if (fs.existsSync(fs.realpathSync(path.join(__dirname, '/../../..')) + `/${process.arch}/${app}`)) { + return fs.realpathSync(path.join(__dirname, '/../../..')) + `/${process.arch}/${app}` + } + try { if (process.platform === 'darwin' && fs.existsSync(fs.realpathSync(path.join(__dirname, '/../../../MacOS')) + `/${app}`)) { return fs.realpathSync(path.join(__dirname, '/../../../MacOS')) + `/${app}` @@ -48,6 +56,10 @@ export default (app) => { return `imports/linux/${app}` } + if (process.platform === 'linux' && fs.existsSync(`imports/linux/${process.arch}/${app}`)) { + return `imports/linux/${process.arch}/${app}` + } + if (process.platform === 'darwin' && fs.existsSync(`imports/darwin/${app}`)) { return `imports/darwin/${app}` }