Skip to content

Commit cd64ea0

Browse files
authored
updateDependencies: ensure bash4+ (#5705)
* macos ships an antique bash3 due to license issues (bash4+ is gpl3) * we didn't want to change to zsh by default because non-macos users may not have it installed * installation of bash5 is easy enough, so provide some instructions...
1 parent 3ccd75a commit cd64ea0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

updateDependencies.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
NON_INTERACTIVE_OPTION=$1
33
DEPENDENCY=$2
44

5+
# Check if Bash version is 4 or higher
6+
if (( BASH_VERSINFO[0] < 4 )); then
7+
echo "Error: Bash version 4 or higher is required." >&2
8+
echo "If you are on a mac, you can switch to a modern bash e.g. with 'brew install bash' and ensure it's in your PATH." >&2
9+
# n.b. if it's not in your PATH, you can do so e.g. by defining "export PATH="/opt/homebrew/bin:$PATH" in your ~/.zshrc
10+
exit 1
11+
fi
12+
513
check_installed() {
614
if ! type "$1" > /dev/null; then
715
echo "Please ensure you have $1 installed."

0 commit comments

Comments
 (0)