Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download latest main #32

Merged
merged 3 commits into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions devel/download-latest
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ CONDA_SUBDIR="${CONDA_SUBDIR:-$("$repo"/devel/conda-subdir)}"
export CONDA_SUBDIR

wget "$(
curl -fsSL https://api.anaconda.org/release/nextstrain/nextstrain-base/latest | jq -r '
.distributions
curl -fsSL https://api.anaconda.org/package/nextstrain/nextstrain-base/files | jq -r '
map(select(.labels|index("main")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking

For boolean containment, jq has a contains() function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided against contains() because it returns true even for substring containments.

The following returns true:

jq 'contains(["ab"])' <<< '["abcde"]'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! That's a good reason.

| map(select(.attrs.subdir == env.CONDA_SUBDIR))
| .[0].download_url
| max_by([.version, .attrs.build_number])
| .download_url
| if startswith("//") then "https:\(.)" else . end
'
)"