From 85570ac207abccbc1593565cc597b43b1d9f7f75 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 20:23:26 +0000 Subject: [PATCH] Add error message for readlink -f failure (#23102) (#23121) * Add error message for readlink -f failure (cherry picked from commit 89f5145f64772ddc9dd6db4690d71bf377da44d4) Co-authored-by: Will Hickey --- 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=()