2011-08-13 06:34:15 +00:00
|
|
|
#!/usr/bin/env bash -e
|
|
|
|
|
|
|
|
RBENV_VERSION="$1"
|
2011-08-13 06:50:23 +00:00
|
|
|
VERSION_FILE=".rbenv-version"
|
2011-08-13 06:34:15 +00:00
|
|
|
if [ -z "$RBENV_VERSION" ]; then
|
2011-08-13 06:50:23 +00: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 06:34:15 +00:00
|
|
|
|
2011-08-13 06:50:23 +00:00
|
|
|
echo "$RBENV_VERSION" > "$VERSION_FILE"
|
|
|
|
fi
|
2011-08-13 06:34:15 +00:00
|
|
|
|