Skip to content

Commit

Permalink
Check Bash version
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 21, 2024
1 parent ae8faf6 commit 53f3314
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 53f3314

Please sign in to comment.