Skip to content

Commit 0686072

Browse files
committed
Merge branch 'dev' into prod
2 parents 6f260e3 + 2b91c85 commit 0686072

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

scripts/postinstall.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const __dirname = path.dirname(__filename);
2121
// ═══════════════════════════════════════════════════════════════════════════════
2222

2323
const CONFIG = {
24-
repoUrl: 'https://api.github.com/repos/OGMatrix/mcmodding-mcp/releases/latest',
24+
repoUrl: 'https://api.github.com/repos/OGMatrix/mcmodding-mcp/releases',
2525
dataDir: path.join(__dirname, '..', 'data'),
2626
dbFileName: 'mcmodding-docs.db',
2727
manifestFileName: 'db-manifest.json',
@@ -653,7 +653,19 @@ async function downloadWithProgress(url, destPath, onProgress) {
653653

654654
async function fetchReleaseInfo() {
655655
const response = await httpsGet(CONFIG.repoUrl);
656-
return JSON.parse(response);
656+
const releases = JSON.parse(response);
657+
658+
// Find the first release that has the required assets
659+
for (const release of releases) {
660+
const hasManifest = release.assets.some((a) => a.name === 'db-manifest.json');
661+
const hasDb = release.assets.some((a) => a.name === 'mcmodding-docs.db');
662+
663+
if (hasManifest && hasDb) {
664+
return release;
665+
}
666+
}
667+
668+
throw new Error('No suitable release found with database artifacts');
657669
}
658670

659671
async function fetchManifest(manifestUrl) {

0 commit comments

Comments
 (0)