-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix electron-updater version check
- Loading branch information
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/out/util/packageMetadata.js b/out/util/packageMetadata.js | ||
index 3d006f7aae80f03aa7f0d8229cd7fdf8c15d9d9e..bf4c60bd48408e6cb320c4ee91a16acdbdaa23c4 100644 | ||
--- a/out/util/packageMetadata.js | ||
+++ b/out/util/packageMetadata.js | ||
@@ -80,11 +80,26 @@ function checkDependencies(dependencies, errors) { | ||
if (dependencies == null) { | ||
return; | ||
} | ||
- const updaterVersion = dependencies["electron-updater"]; | ||
- const requiredElectronUpdaterVersion = "4.0.0"; | ||
- if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) { | ||
- errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"`); | ||
- } | ||
+ | ||
+ let updaterVersion = dependencies["electron-updater"] | ||
+ if (updaterVersion != null) { | ||
+ // Pick the version of a yarn berry patch syntax | ||
+ // "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch" | ||
+ if (updaterVersion.startsWith('patch:')) { | ||
+ const match = updaterVersion.match(/@npm%3A(.+?)#/) | ||
+ if (match) { | ||
+ updaterVersion = match[1] | ||
+ } | ||
+ } | ||
+ | ||
+ const requiredElectronUpdaterVersion = "4.0.0" | ||
+ if (!versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) { | ||
+ errors.push( | ||
+ `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"` | ||
+ ) | ||
+ } | ||
+ } | ||
+ | ||
const swVersion = dependencies["electron-builder-squirrel-windows"]; | ||
if (swVersion != null && !versionSatisfies(swVersion, ">=20.32.0")) { | ||
errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to "^20.32.0"`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,5 +55,8 @@ | |
"engines": { | ||
"node": "^20.14" | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"resolutions": { | ||
"app-builder-lib@npm:26.0.1": "patch:app-builder-lib@npm%3A26.0.1#~/.yarn/patches/app-builder-lib-npm-26.0.1-df3cd7e47a.patch" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters