2011-08-13 02:34:15 -04:00
|
|
|
#!/usr/bin/env bash -e
|
|
|
|
|
|
|
|
RBENV_VERSION="$1"
|
2011-08-13 02:50:23 -04:00
|
|
|
VERSION_FILE=".rbenv-version"
|
2011-08-13 02:34:15 -04:00
|
|
|
if [ -z "$RBENV_VERSION" ]; then
|
2011-08-13 02:50:23 -04:00
|
|
|
if [[ -e "$VERSION_FILE" ]]; then
|
|
|
|
cat "$VERSION_FILE"
|
|
|
|
else
|
|
|
|
echo "No local version configured - set with: rbenv local <version>"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# Make sure the specified version is installed
|
|
|
|
rbenv-prefix "$RBENV_VERSION" >/dev/null
|
2011-08-13 02:34:15 -04:00
|
|
|
|
2011-08-13 02:50:23 -04:00
|
|
|
echo "$RBENV_VERSION" > "$VERSION_FILE"
|
|
|
|
fi
|
2011-08-13 02:34:15 -04:00
|
|
|
|