2011-08-18 15:11:40 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2011-09-12 11:11:59 -04:00
|
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
2011-08-18 15:11:40 -04:00
|
|
|
|
|
|
|
RBENV_VERSION_FILE="$1"
|
|
|
|
RBENV_VERSION="$2"
|
|
|
|
|
|
|
|
if [ -z "$RBENV_VERSION" ] || [ -z "$RBENV_VERSION_FILE" ]; then
|
2012-10-08 08:47:52 -04:00
|
|
|
echo "usage: rbenv version-file-write FILENAME VERSION" >&2
|
2011-08-18 16:28:35 -04:00
|
|
|
exit 1
|
2011-08-18 15:11:40 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Make sure the specified version is installed.
|
|
|
|
rbenv-prefix "$RBENV_VERSION" >/dev/null
|
|
|
|
|
|
|
|
# Write the version out to disk.
|
|
|
|
echo "$RBENV_VERSION" > "$RBENV_VERSION_FILE"
|