mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-01 14:44:48 +01:00
Show usage
This commit is contained in:
parent
a72a81b911
commit
7b4b51a79e
1 changed files with 18 additions and 1 deletions
|
@ -6,4 +6,21 @@ if [ -z "$RBENV_ROOT" ]; then
|
|||
RBENV_ROOT="${HOME}/.rbenv"
|
||||
fi
|
||||
|
||||
exec ruby-build "$1" "${RBENV_ROOT}/versions/$1"
|
||||
DEFINITION="$1"
|
||||
case "$DEFINITION" in
|
||||
"" | -* )
|
||||
{ echo "usage: rbenv install VERSION"
|
||||
echo " rbenv install /path/to/definition"
|
||||
echo
|
||||
echo "Available versions:"
|
||||
ruby-build --definitions | sed 's/^/ /'
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
|
||||
|
||||
exec ruby-build "$DEFINITION" "$PREFIX"
|
||||
|
|
Loading…
Reference in a new issue