From 04852958b9ff9b4f52616daf975ef9e20105c70e Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Fri, 13 Dec 2024 17:24:17 -0300 Subject: [PATCH] contrib: check if the user has cargo-public-api --- contrib/check-for-api-changes.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/check-for-api-changes.sh b/contrib/check-for-api-changes.sh index dc305dca0..3bfe41571 100755 --- a/contrib/check-for-api-changes.sh +++ b/contrib/check-for-api-changes.sh @@ -22,6 +22,7 @@ export LC_ALL=C main() { need_nightly + need_cargo_public_api generate_api_files "hashes" generate_api_files "io" @@ -81,6 +82,13 @@ need_nightly() { fi } +need_cargo_public_api() { + if command -v cargo-public-api > /dev/null; then + return + fi + err "cargo-public-api is not installed; please run 'cargo +nightly install cargo-public-api --locked'" +} + err() { echo "$1" >&2 exit 1