mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-19 20:51:59 +01:00
31 lines
605 B
Bash
Executable file
31 lines
605 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
|
|
|
# Provide rbenv completions
|
|
if [ "$1" = "--complete" ]; then
|
|
exec ruby-build --definitions
|
|
fi
|
|
|
|
if [ -z "$RBENV_ROOT" ]; then
|
|
RBENV_ROOT="${HOME}/.rbenv"
|
|
fi
|
|
|
|
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"
|