From 89255a8c84d6056e709f80a2984626c771f84c01 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 20 Sep 2023 12:22:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddev=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-config/build-before-pack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-config/build-before-pack.js b/build-config/build-before-pack.js index e4276796..f4674d5c 100644 --- a/build-config/build-before-pack.js +++ b/build-config/build-before-pack.js @@ -53,7 +53,8 @@ const replaceQrcDecodeLib = async(electronNodeAbi, platform, arch) => { module.exports = async(context) => { const { electronPlatformName, arch } = context - const electronNodeAbi = nodeAbi.getAbi(context.packager.info._framework.version, 'electron') + const electronVersion = context.packager?.info?._framework?.version ?? require('../package.json').devDependencies.electron.replace(/.*?(\d+)/, '$1') + const electronNodeAbi = nodeAbi.getAbi(electronVersion, 'electron') await replaceQrcDecodeLib(electronNodeAbi, electronPlatformName, arch) if (electronPlatformName !== 'linux' || process.env.FORCE) return const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp')