#!/bin/sh # Development helper: run cargo with the repository-local dependency cache. # # The cache directory `.cargo-home/` is ignored by git and is not required for a # clean environment that can reach crates.io. It only makes repeated builds in # an offline sandbox reproducible. set -eu ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) if ! command -v cargo >/dev/null 2>&1; then for candidate in "$HOME/.cargo/bin" "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin"; do if [ -x "$candidate/cargo" ]; then PATH="$candidate:$PATH" export PATH break fi done fi if ! command -v cargo >/dev/null 2>&1; then echo "scripts/cargo.sh: cargo not found; install a Rust toolchain (MSRV 1.89)" >&2 exit 2 fi if [ -d "$ROOT/.cargo-home" ]; then CARGO_HOME="$ROOT/.cargo-home" export CARGO_HOME fi exec cargo "$@"