From 954c3596b27290913f502877ba12ea9f12132073 Mon Sep 17 00:00:00 2001 From: XuehaiPan Date: Wed, 15 Sep 2021 17:10:05 +0800 Subject: [PATCH] brew: fail fast when not using bash --- bin/brew | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/brew b/bin/brew index 78eaa033b7..3d75d3654a 100755 --- a/bin/brew +++ b/bin/brew @@ -7,6 +7,12 @@ if ! [[ -d "${PWD}" ]]; then exit 1 fi +# Fail fast with concise message when not using bash +if [ -z "${BASH_VERSION:-}" ]; then + echo "Error: Bash is required to run brew." >&2 + exit 1 +fi + quiet_cd() { cd "$@" &>/dev/null || return }