fix: check target version key when updating versions.json

Check whether the target version key already exists instead of whether the minAppVersion value exists.
The old check incorrectly skipped writing a new entry when a prior release mapped to the same minimum app version.
Ensures every release gets its own entry in the version map.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Lukas Wolfsteiner 2026-07-06 11:21:14 +02:00
parent 0a6af4ed0f
commit 9db030eb8c

View file

@ -11,7 +11,7 @@ writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
// update versions.json with target version and minAppVersion from manifest.json
// but only if the target version is not already in versions.json
const versions = JSON.parse(readFileSync('versions.json', 'utf8'));
if (!versions[targetVersion]) {
versions[targetVersion] = minAppVersion;
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
if (!(targetVersion in versions)) {
versions[targetVersion] = minAppVersion;
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
}