Skip to content

Commit

Permalink
Refactor devel/download-latest
Browse files Browse the repository at this point in the history
Thanks @tsibley for pointing out that `max_by` accepts an array of paths and will sort in order of the provided array.

Co-authored-by: Thomas Sibley <[email protected]>
  • Loading branch information
joverlee521 and tsibley authored May 23, 2023
1 parent d505788 commit 804a435
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions devel/download-latest
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ wget "$(
curl -fsSL https://api.anaconda.org/package/nextstrain/nextstrain-base/files | jq -r '
map(select(.labels|index("main")))
| map(select(.attrs.subdir == env.CONDA_SUBDIR))
| (max_by(.version) | .version) as $max_version
| .
| map(select(.version == $max_version))
| max_by(.attrs.build_number)
| max_by([.version, .attrs.build_number])
| .download_url
| if startswith("//") then "https:\(.)" else . end
'
Expand Down

0 comments on commit 804a435

Please sign in to comment.