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:
+5
-1
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user