diff --git a/bin/rbenv-install b/bin/rbenv-install index 51ae0b6..992ccd7 100755 --- a/bin/rbenv-install +++ b/bin/rbenv-install @@ -9,7 +9,7 @@ then exit fi -if [ "$1" == "ruby" ] && [ ! -z "$2" ]; then +if [[ "$1" == "ruby" ]] && [[ ! -z "$2" ]]; then RUBY_VER="$2" echo "Note: This is just a small wrapper around 'ruby-install' to prefill the 'install-dir' params for rbenv support" @@ -19,7 +19,7 @@ if [ "$1" == "ruby" ] && [ ! -z "$2" ]; then RBINSTDIR="$HOME/.rbenv/versions/$RUBY_VER" RBINSTCMD="ruby-install --install-dir \"$RBINSTDIR\" ruby $RUBY_VER" - if [ -d "$RBINSTDIR" ]; then + if [[ -d "$RBINSTDIR" ]]; then echo "It appears that the install directory already exists:" echo " $RBINSTDIR" echo @@ -45,13 +45,19 @@ if [ "$1" == "ruby" ] && [ ! -z "$2" ]; then echo "Wasn't ok, so we're quitting. Maybe try using 'ruby-install' directly?" exit fi -elif [ "$1" == "versions" ] || [ "$1" == "list" ]; then - exec ruby-install +elif [[ "$1" == "versions" ]] || [[ "$1" == "list" ]]; then + # This will download the latest versions, then display them + exec ruby-install --latest +elif [[ "$1" == "update" ]] || [[ "$1" == "--update" ]] || [[ "$1" == "--latest" ]] || [[ "$1" == "-L" ]]; then + exec ruby-install --latest else - echo "This wrapper only handles one small case.. which you didn't hit. Did you want to just use 'ruby-install' directly?" + echo "This wrapper only handles a couple of small cases.. which you didn't hit." + echo + echo "Did you want to just use 'ruby-install' directly?" echo echo "Usage:" echo " $0 ruby VERSION : Install the given VERSION using 'ruby-install'" echo " $0 versions : List available versions to install" + echo " $0 update : Update list of ruby versions" exit fi