Skip to content

Commit

Permalink
improve bash version detection, update #918, also add ZSH version det…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
mpapis committed Apr 23, 2012
1 parent ca74ebd commit 2c83f25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 5 additions & 10 deletions binscripts/rvm-installer
@@ -1,15 +1,10 @@
#!/usr/bin/env bash

BASH_MAJOR_REQUIRED=3
BASH_MINOR_REQUIRED=2
BASH_MAJOR=${BASH_VERSION:0:1}
BASH_MINOR=${BASH_VERSION:2:1}
if [[ 1 != $(($BASH_MAJOR > $BASH_MAJOR_REQUIRED ||
$BASH_MAJOR == $BASH_MAJOR_REQUIRED &&
$BASH_MINOR >= $BASH_MINOR_REQUIRED)) ]]; then
echo -n "bash v$BASH_MAJOR_REQUIRED.$BASH_MINOR_REQUIRED required" \
"(you have $BASH_VERSION)"
exit 1
if [[ -n "${BASH_VERSION:-}" ]] &&
(( 65536 * ${BASH_VERSINFO[0]} + 256 * ${BASH_VERSINFO[1]} + ${BASH_VERSINFO[2]} >= 197168 ))
then
echo "BASH 3.2.48 required (you have $BASH_VERSION)"
exit 1
fi

shopt -s extglob
Expand Down
10 changes: 10 additions & 0 deletions scripts/notes
Expand Up @@ -126,6 +126,16 @@ $notes_type Notes:
otherwise add it to ~/.bash_login:
source ~/.profile
"
fi

if [[ -n "${ZSH_VERSION:-}" ]] &&
(( 65536 * ${ZSH_VERSION:0:1} + 256 * ${ZSH_VERSION:2:1} + ${ZSH_VERSION:4} != 262924 ))
then
printf "%b" "
* WARNING: ZSH 4.3.12 is recommended, you have $ZSH_VERSION.
"
fi
} | new_notes | eval "${PAGER:-cat}"
Expand Down

2 comments on commit 2c83f25

@mkuipers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey.... I think this update broke the install script. I'll put up an issue.

@phildobbin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's not working on OS X...

Please sign in to comment.