#!/usr/bin/env bash set -e usage() { cat <&2 echo "Tag must start with the branch name (unless branch is master). Tag: $tag Branch: $branch" exit 1 fi here="$(dirname "$0")" cd "$here"/.. source scripts/read-cargo-variable.sh ignores=( .cache .cargo target web3.js/test node_modules ) not_paths=() for ignore in "${ignores[@]}"; do not_paths+=(-not -path "*/$ignore/*") done # shellcheck disable=2207 Cargo_tomls=($(find . -mindepth 2 -name Cargo.toml "${not_paths[@]}")) for Cargo_toml in "${Cargo_tomls[@]}"; do manifest_version="$(readCargoVariable version "${Cargo_toml}")" if ! [[ "v$manifest_version" == "$tag" ]]; then >&2 echo "Tag must match the crate version in the manifest files. Mismatch found in $Cargo_toml. Tag: $tag Manifest version: $manifest_version" exit 1 else echo "tag matches manifest: $Cargo_toml $manifest_version $tag" fi done