Skip to content

Commit

Permalink
chore: update-prompt pass target to api
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jan 17, 2025
1 parent b15273c commit 56a3e65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions update-prompt/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56a3e65

Please sign in to comment.