From 688f8110f4a556aa2cc1ad828d74624ee427c1f4 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Wed, 3 Jan 2024 12:36:55 +0100 Subject: [PATCH] Find latest Julia version correctly --- src/_includes/welcome.jlhtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_includes/welcome.jlhtml b/src/_includes/welcome.jlhtml index 170a743..78eb469 100644 --- a/src/_includes/welcome.jlhtml +++ b/src/_includes/welcome.jlhtml @@ -355,7 +355,8 @@ const run = f => f(); run(async () => { const versions = await (await fetch(`https://julialang-s3.julialang.org/bin/versions.json`)).json() - const version_names = Object.keys(versions).sort().reverse() + const sortby = v => v.split("-")[0].split(".").map(parseFloat).reduce((a,b) => a*10000 + b) + const version_names = Object.keys(versions).sort((a,b) => sortby(a) - sortby(b)).reverse() const stable = version_names.find(v => versions[v].stable) console.log({stable}) const pkg_stable = /\\d+\\.\\d+/.exec(stable)[0]