pyenv/libexec/rbenv-version-file-write

18 lines
413 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x
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
exit 1
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"