at 23.11-beta 2.0 kB view raw
1diff --git a/electron/BUILD.gn b/electron/BUILD.gn 2index c905891eb8..f2cf11fe88 100644 3--- a/electron/BUILD.gn 4+++ b/electron/BUILD.gn 5@@ -111,8 +111,6 @@ electron_version = exec_script("script/print-version.py", 6 [], 7 "trim string", 8 [ 9- ".git/packed-refs", 10- ".git/HEAD", 11 "script/lib/get-version.js", 12 ]) 13 14diff --git a/electron/script/lib/get-version.js b/electron/script/lib/get-version.js 15index 45a120482b..ddaf8ab60e 100644 16--- a/electron/script/lib/get-version.js 17+++ b/electron/script/lib/get-version.js 18@@ -1,22 +1 @@ 19-const { spawnSync } = require('node:child_process'); 20-const path = require('node:path'); 21- 22-module.exports.getElectronVersion = () => { 23- // Find the nearest tag to the current HEAD 24- // This is equivilant to our old logic of "use a value in package.json" for the following reasons 25- // 26- // 1. Whenever we updated the package.json we ALSO pushed a tag with the same version 27- // 2. Whenever we _reverted_ a bump all we actually did was push a commit that deleted the tag and changed the version number back 28- // 29- // The only difference in the "git describe" technique is that technically a commit can "change" it's version 30- // number if a tag is created / removed retroactively. i.e. the first time a commit is pushed it will be 1.2.3 31- // and after the tag is made rebuilding the same commit will result in it being 1.2.4 32- const output = spawnSync('git', ['describe', '--tags', '--abbrev=0'], { 33- cwd: path.resolve(__dirname, '..', '..') 34- }); 35- if (output.status !== 0) { 36- console.error(output.stderr); 37- throw new Error('Failed to get current electron version'); 38- } 39- return output.stdout.toString().trim().replace(/^v/g, ''); 40-}; 41+module.exports.getElectronVersion = () => "@version@"; 42