2011-08-18 19:11:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2011-09-12 15:11:59 +00:00
|
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
2011-08-18 19:11:40 +00:00
|
|
|
|
|
|
|
RBENV_VERSION_FILE="$1"
|
|
|
|
RBENV_VERSION="$2"
|
|
|
|
|
|
|
|
if [ -z "$RBENV_VERSION" ] || [ -z "$RBENV_VERSION_FILE" ]; then
|
2012-10-08 12:47:52 +00:00
|
|
|
echo "usage: rbenv version-file-write FILENAME VERSION" >&2
|
2011-08-18 20:28:35 +00:00
|
|
|
exit 1
|
2011-08-18 19:11:40 +00: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"
|