From 944ad29e0ae7e21588aeb9fa02e9fbd6f8c240bc Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Thu, 10 Oct 2024 16:32:07 +0200 Subject: [PATCH] Fix auto Julia version in installation.md --- src/installation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/installation.md b/src/installation.md index 1ed1eba..010622e 100644 --- a/src/installation.md +++ b/src/installation.md @@ -142,7 +142,8 @@ After working on your notebook (your code is autosaved when you run it), you wil 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]