fix: accept equivalent installer metadata names

Allow updater manifests from the Gitea and GitHub release pipelines to use different separator characters in the same installer filename while preserving exact version, size, checksum, and executable validation.
This commit is contained in:
Sucukdeluxe
2026-08-17 03:29:00 +02:00
parent 329d22e5b7
commit 6a2eda1252
2 changed files with 20 additions and 1 deletions
+5 -1
View File
@@ -61,6 +61,10 @@ function findLatestYml(assets) {
return assets.find(a => /^latest\.yml$/i.test(a.name)) || null;
}
function normalizeInstallerName(value) {
return path.basename(String(value || '')).toLowerCase().replace(/[ ._]+/g, '');
}
async function fetchJson(url, signal) {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT);
@@ -180,7 +184,7 @@ async function parseLatestYml(url, expected = {}, fetchImpl = fetch) {
if (expected.version && version !== expected.version) {
throw new Error('Prüfsummen-Metadaten gehören zu einer anderen Version');
}
if (expected.assetName && path.basename(assetPath) !== path.basename(expected.assetName)) {
if (expected.assetName && normalizeInstallerName(assetPath) !== normalizeInstallerName(expected.assetName)) {
throw new Error('Prüfsummen-Metadaten gehören nicht zum ausgewählten Installer');
}
if (expected.assetSize && size !== Number(expected.assetSize)) {