From 804a435ede9477a80e7b3f5cefb4ffc92ce3f17e Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Tue, 23 May 2023 14:13:41 -0700 Subject: [PATCH] Refactor devel/download-latest 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 --- devel/download-latest | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devel/download-latest b/devel/download-latest index 85a80cb..31b10c0 100755 --- a/devel/download-latest +++ b/devel/download-latest @@ -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 '