From e90e8fa9df43446bc8a4fd5df327f15b42aa3e98 Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Wed, 15 Jul 2020 21:02:59 +0200 Subject: [PATCH] dev: check version of bash on startup (#12204) If you are using an old version of bash our dev scripts fails in subtle ways. For example we will detect file changes, but recompilation will fail. This check ensures a dev is on version 5 of bash. If not it fails the script and informs them how to upgrade. --- dev/start.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/start.sh b/dev/start.sh index db8648283eb..9491cf1f754 100755 --- a/dev/start.sh +++ b/dev/start.sh @@ -2,6 +2,13 @@ set -euf -o pipefail +if [[ ${BASH_VERSION:0:1} -lt 5 ]]; then + echo "Please upgrade bash to version 5. Currently on ${BASH_VERSION}." + echo + echo " brew install bash" + exit 1 +fi + unset CDPATH cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to repo root dir