Skip to content

Commit

Permalink
Smarter check for missing
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Apr 30, 2024
1 parent 224f5a1 commit 754f5cd
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions util/flashcn.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ async function listRelease() {
const r = [];
const ids = new Set();
for (const [id, info] of Object.entries(versions)) {
if (id.startsWith('fc-')) {
continue;
}

ids.add(id);

if (dupes.has(id)) {
if (id.startsWith('fc-') || dupes.has(id)) {
continue;
}

Expand All @@ -144,6 +138,7 @@ async function listRelease() {
if (!type) {
throw new Error(`Unknown id: ${id}`);
}

r.push({
name: `flash-player-${info.version}-${type}-cn`,
file: urlFile(source),
Expand All @@ -155,15 +150,12 @@ async function listRelease() {
version: info.version,
size: info.size
});
ids.add(id);
}

for (const [id, duped] of dupes) {
if (ids.has(id)) {
const missing = duped.filter(id => !ids.has(id));
if (missing.length) {
throw new Error(`Missing ${id} dupes: ${missing.join(',')}`);
}
}
const missing = [...idRelease.keys()].filter(s => !ids.has(s));
if (missing.length) {
throw new Error(`Missing: ${missing.join(',')}`);
}

return r;
Expand Down Expand Up @@ -236,6 +228,12 @@ async function listDebug() {
});
ids.add(id);
}

const missing = [...idDebug.keys()].filter(s => !ids.has(s));
if (missing.length) {
throw new Error(`Missing: ${missing.join(',')}`);
}

return r;
}

Expand Down

0 comments on commit 754f5cd

Please sign in to comment.