miden-crypto/scripts/check-rust-version.sh
scripts/check-rust-version.shRaw
1#!/bin/bash
2
3# Get rust-toolchain.toml file channel
4TOOLCHAIN_VERSION=$(grep 'channel' rust-toolchain.toml | sed -E 's/.*"(.*)".*/\1/')
5
6# Get workspace Cargo.toml file rust-version
7CARGO_VERSION=$(grep 'rust-version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/')
8
9# Check version match
10if [ "$CARGO_VERSION" != "$TOOLCHAIN_VERSION" ]; then
11 echo "Mismatch in Cargo.toml: Expected $TOOLCHAIN_VERSION, found $CARGO_VERSION"
12 exit 1
13fi
14
15echo "Rust versions match ✅"