Skip to content

Commit

Permalink
Check Bash version
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga authored and cantino committed Aug 12, 2024
1 parent 3835b65 commit cdbb5fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mcfly.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash

function mcfly_initialize {
# Note: We avoid using [[ ... ]] to check the Bash version because we are
# even unsure whether it is available before confirming the Bash version.
if [ -z "${BASH_VERSINFO-}" ] || [ "${BASH_VERSINFO-}" -lt 3 ]; then
printf 'mcfly.bash: This setup requires Bash >= 3.0.' >&2
return 1
fi

unset -f "${FUNCNAME[0]}"

# Ensure stdin is a tty
Expand Down

0 comments on commit cdbb5fe

Please sign in to comment.