Skip to content

Commit

Permalink
Check for Bash 4.3+ and exit if requirements aren't met
Browse files Browse the repository at this point in the history
  • Loading branch information
chaifeng committed Aug 13, 2024
1 parent d7e4caf commit dc8918f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bach.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# -*- mode: sh -*-
# Bach Testing Framework, https://bach.sh
# Bach Unit Testing Framework, https://bach.sh
# Copyright (C) 2019 Chai Feng <[email protected]>
#
# Bach Testing Framework is dual licensed under:
# Bach Unit Testing Framework is dual licensed under:
# - GNU General Public License v3.0
# - Mozilla Public License 2.0
set -euo pipefail
IFS='.' read -r __major __minor _ <<< "${BASH_VERSION:-0.0.0}"
if [ "$__major" -lt 4 ] || { [ "$__major" -eq 4 ] && [ "$__minor" -lt 3 ]; }; then
echo "Error: Bach Unit Testing Framework requires Bash version 4.3 or higher. Your current version is ${BASH_VERSION:-unknown}." >&2
exit 1
fi
shopt -s expand_aliases

builtin export BACH_COLOR="${BACH_COLOR:-auto}"
Expand Down

0 comments on commit dc8918f

Please sign in to comment.