From 524975291f79e48f255115160d110fc497177de1 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 6 Oct 2023 20:34:49 +0100 Subject: [PATCH] fix: use the electron version, not the app's version COMPASS-7305 (#4962) use the electron version, not the app's version --- packages/hadron-build/commands/release.js | 8 ++++++-- packages/hadron-build/lib/target.js | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/hadron-build/commands/release.js b/packages/hadron-build/commands/release.js index 465cfce4d7a..3fee4a5b816 100644 --- a/packages/hadron-build/commands/release.js +++ b/packages/hadron-build/commands/release.js @@ -190,9 +190,13 @@ const fixCompass5333 = (CONFIG, done) => { * @api public */ const writeVersionFile = (CONFIG, done) => { - return CONFIG.write('version', CONFIG.version) + // This version will be used by electron-installer-common to determine which + // dependencies of electron to include. + const version = CONFIG.packagerOptions.electronVersion; + + return CONFIG.write('version', version) .then(dest => { - cli.debug(format('version written to `%s`', dest)); + cli.debug(format('version `%s` written to `%s`', version, dest)); if (done) { done(null, true); } diff --git a/packages/hadron-build/lib/target.js b/packages/hadron-build/lib/target.js index ca5fb7610cb..3fce92e4302 100644 --- a/packages/hadron-build/lib/target.js +++ b/packages/hadron-build/lib/target.js @@ -288,6 +288,8 @@ class Target { } debug(`Writing ${contents.length} bytes to ${dest}`); await fs.promises.writeFile(dest, contents); + + return dest; // this is used by the caller } /**