diff --git a/update-prompt/main.js b/update-prompt/main.js index 96c23cc..6aed711 100644 --- a/update-prompt/main.js +++ b/update-prompt/main.js @@ -13,14 +13,14 @@ try { } async function getLatestBuildsForBranch(branch, targetCount) { - targetCount *= 10 // HACK until the api changes - const rawData = await fetch(`https://api.bitfocus.io/v1/product/companion/packages?branch=${branch}&limit=${targetCount}`) - const data = await rawData.json() - - // TODO - make sure this is durable + // This is a bit fragile, but is good enough let target = `${process.platform}-${process.arch}-tgz` if (target === 'linux-x64-tgz') target = 'linux-tgz' + targetCount *= 10 // HACK until the api changes + const rawData = await fetch(`https://api.bitfocus.io/v1/product/companion/packages?branch=${branch}&limit=${targetCount}&target=${target}`) + const data = await rawData.json() + // console.log('searching for', target, 'in', data.packages) // assume the builds are sorted by date already