Skip to content

Commit

Permalink
warn bash 4 - 4.1.999 users of lack of compatibility issues, update #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Oct 28, 2014
1 parent 0b69bf3 commit 9370330
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions binscripts/rvm-installer
Expand Up @@ -4,18 +4,34 @@ shopt -s extglob
set -o errtrace
set -o errexit

__rvm_older_version()
{
\printf "%b" "${1:-}\n${2}\n" | LC_ALL=C \sort -t"." -k1,1n -k2,2n -k3,3n | \head -n1
}

rvm_install_initialize()
{
DEFAULT_SOURCES=(github.com/wayneeseguin/rvm bitbucket.org/mpapis/rvm)

BASH_MIN_VERSION="3.2.25"
if
[[ -n "${BASH_VERSION:-}" &&
"$(\printf "%b" "${BASH_VERSION:-}\n${BASH_MIN_VERSION}\n" | LC_ALL=C \sort -t"." -k1,1n -k2,2n -k3,3n | \head -n1)" != "${BASH_MIN_VERSION}"
]]
[[ -n "${BASH_VERSION:-}" ]]
then
echo "BASH ${BASH_MIN_VERSION} required (you have $BASH_VERSION)"
exit 1
if
[[ "$(__rvm_older_version "${BASH_VERSION:-}" "${BASH_MIN_VERSION}")" != "${BASH_MIN_VERSION}" ]]
then
echo "
BASH ${BASH_MIN_VERSION} required (you have $BASH_VERSION)
" >&2
exit 1
elif
[[ "$(__rvm_older_version "${BASH_VERSION:-}" "4.0.0")" == "4.0.0" ]] &&
[[ "$(__rvm_older_version "${BASH_VERSION:-}" "4.2.0")" != "4.2.0" ]]
then
echo "
BASH ${BASH_MIN_VERSION} or 4.2+ is required, you have '$BASH_VERSION' which might be not fully supported.
" >&2
fi
fi

export HOME PS4
Expand Down

0 comments on commit 9370330

Please sign in to comment.