Browse Source

build: strip v in the getElectronVersion helper

Samuel Attard 2 years ago
parent
commit
99a34d5209
2 changed files with 2 additions and 1 deletions
  1. 1 0
      BUILD.gn
  2. 1 1
      script/lib/get-version.js

+ 1 - 0
BUILD.gn

@@ -113,6 +113,7 @@ electron_version = exec_script("script/print-version.py",
                                [
                                  ".git/packed-refs",
                                  ".git/HEAD",
+                                 "script/lib/get-version.js",
                                ])
 
 if (is_mas_build) {

+ 1 - 1
script/lib/get-version.js

@@ -18,5 +18,5 @@ module.exports.getElectronVersion = () => {
     console.error(output.stderr);
     throw new Error('Failed to get current electron version');
   }
-  return output.stdout.toString().trim();
+  return output.stdout.toString().trim().replace(/^v/g, '');
 };