From 89f5145f64772ddc9dd6db4690d71bf377da44d4 Mon Sep 17 00:00:00 2001 From: Will Hickey Date: Mon, 14 Feb 2022 13:16:13 -0600 Subject: [PATCH] Add error message for readlink -f failure (#23102) * Add error message for readlink -f failure --- scripts/cargo-for-all-lock-files.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/cargo-for-all-lock-files.sh b/scripts/cargo-for-all-lock-files.sh index c2cbd1c4ec..d709df4d43 100755 --- a/scripts/cargo-for-all-lock-files.sh +++ b/scripts/cargo-for-all-lock-files.sh @@ -3,6 +3,13 @@ here="$(dirname "$0")" cargo="$(readlink -f "${here}/../cargo")" +if [[ -z $cargo ]]; then + >&2 echo "Failed to find cargo. Mac readlink doesn't support -f. Consider switching + to gnu readlink with 'brew install coreutils' and then symlink greadlink as + /usr/local/bin/readlink." + exit 1 +fi + set -e shifted_args=()