I want to start a computation using the exact same Julia version that is in the manifest on a server, where I am using juliaup
. It that exact same version is not available, I prefer to throw an error.
I am unsure about the best way of extracting the version from the manifest. I can use standard Unix tools, eg as in the script
#!/bin/bash
JULIA_VERSION=`sed -n 's/julia_version\s*=\s*"\(.*\)"/\1/p' Manifest.toml`
julia +$JULIA_VERSION -t auto --project=@. run_computation.jl
or I could do it in Julia, as in
JULIA_VERSION=`julia -e 'import TOML; print(TOML.parsefile("./Manifest.toml")["julia_version"])'`
but I am wondering if it would make sense to have a simple command line tool for this, that could perhaps look for a Manifest.toml
in the parent directories too if one is not found in the current directory.
I wonder how people script this.