1#!/usr/bin/env bash
Fail if a version written outside mise.toml differs from the one in it. mise.toml is the one place versions live; these are the few other files that cannot read it and so repeat one.
tools/check-versions.sh
Needs only POSIX tools: it reads mise.toml's key = "value" lines, not a TOML parser.
first quoted value on the first line of $2 that starts with $1 (the key, as written)
16wb="$(tool 'cargo:wasm-bindgen-cli')" 17[ -n "$wb" ] || bad "mise.toml has no cargo:wasm-bindgen-cli" 18for f in web/Cargo.toml backend/worker/Cargo.toml; do 19 pin="$(grep -m1 -E '^wasm-bindgen *= *"=' "$f" | sed -E 's/.*"=([^"]*)".*/\1/')" 20 [ "$pin" = "$wb" ] || bad "$f pins wasm-bindgen $pin, mise.toml installs the CLI $wb" 21done 22 23platform="$(val android_platform mise.toml)"; platform="${platform%.0}"; tools_v="$(val android_build_tools mise.toml)" 24g=android/app/build.gradle.kts 25[ "$(sed -nE 's/^ *compileSdk = ([0-9]+).*/\1/p' $g)" = "$platform" ] || bad "$g compileSdk differs from android_platform ($platform)" 26[ "$(sed -nE 's/^ *buildToolsVersion = "([^"]*)".*/\1/p' $g)" = "$tools_v" ] || bad "$g buildToolsVersion differs from android_build_tools ($tools_v)" 27 28jdk="$(tool java | sed -E 's/^[a-z]+-([0-9]+).*/\1/')" 29[ "$(sed -nE 's/^ *jvmToolchain\(([0-9]+)\).*/\1/p' $g)" = "$jdk" ] || bad "$g jvmToolchain differs from the JDK in mise.toml ($jdk)" 30 31hk="$(tool hk)" 32grep -q "hk@$hk#" hk.pkl || bad "hk.pkl does not reference hk $hk (the release mise.toml installs)"
Nothing may pin a tool version in the flake: it only wraps mise.