Skip to content

Commit bb21e63

Browse files
committed
core: Fix version check
Previously it would report that Bash 4.0 and 4.1 were unsupported. Since Bash always sets `BASH_VERSION`, it's not practical to write an automated test unless different versions of the Bash binary are available. I may add one, but since I've tested it manually on my machine and this condition isn't likely to ever change, it's probably not worth it.
1 parent 31f8622 commit bb21e63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

go-core.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
# https://mike-bland.com/
2727
# https://github.com/mbland
2828

29-
if [[ "${BASH_VERSINFO[0]}" -lt '3' || "${BASH_VERSINFO[1]}" -lt '2' ]]; then
29+
if [[ "${BASH_VERSINFO[0]}" -lt '3' ||
30+
( "${BASH_VERSINFO[0]}" -eq '3' && "${BASH_VERSINFO[1]}" -lt '2' ) ]]; then
3031
printf "This module requires bash version 3.2 or greater:\n %s %s\n" \
3132
"$BASH" "$BASH_VERSION"
3233
exit 1

0 commit comments

Comments
 (0)