From 56a3e657e94ec064df05ca18f4d5a32a47582b33 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Fri, 17 Jan 2025 11:50:43 +0000 Subject: [PATCH] chore: update-prompt pass target to api --- update-prompt/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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