Skip to content

Commit

Permalink
Use find instead of filter
Browse files Browse the repository at this point in the history
Co-authored-by: Shon Feder <[email protected]>
  • Loading branch information
thpani and Shon Feder authored Aug 24, 2023
1 parent 88affaf commit 2ee568a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions quint/src/quintVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ async function fetchApalache(): Promise<VerifyResult<string>> {
const releases = resp.data.map((element: { tag_name: string }) => element.tag_name)
const latestTaggedVersion = semver.maxSatisfying(releases, APALACHE_VERSION_TAG)
// Filter release response to get dist archive asset URL
const taggedReleases = resp.data.filter(
(element: { tag_name: string }) => element.tag_name == latestTaggedVersion
)
const tgzAssets = taggedReleases[0].assets.filter((asset: { name: string }) => asset.name == APALACHE_TGZ)
const downloadUrl = tgzAssets[0].browser_download_url
const downloadUrl = resp.data
.find((element: any) => element.tag_name == latestTaggedVersion)
?.assets
.find((asset: any) => asset.name == APALACHE_TGZ)
?.browser_download_url
// Check if we have already downloaded this release
const unpackPath = path.join(os.homedir(), '.quint', `apalache-dist-${latestTaggedVersion}`)
const apalacheBinary = path.join(unpackPath, 'apalache', 'bin', 'apalache-mc')
Expand Down

0 comments on commit 2ee568a

Please sign in to comment.