pyenv/libexec/rbenv-default
Graham Ashton 1ed231cb21 Report default or local version.
If no argument is passed to the default or local sub commands, report
the currently configured version.
2011-08-13 08:26:54 +01:00

16 lines
406 B
Bash
Executable file

#!/usr/bin/env bash -e
RBENV_VERSION="$1"
VERSION_FILE="${HOME}/.rbenv/default"
if [ -z "$RBENV_VERSION" ]; then
if [[ -e "$VERSION_FILE" ]]; then
cat "$VERSION_FILE"
else
echo "No default version configured - set with: rbenv default <version>"
fi
else
# Make sure the specified version is installed
rbenv-prefix "$RBENV_VERSION" >/dev/null
echo "$RBENV_VERSION" > "$VERSION_FILE"
fi