mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
1ed231cb21
If no argument is passed to the default or local sub commands, report the currently configured version.
17 lines
395 B
Bash
Executable file
17 lines
395 B
Bash
Executable file
#!/usr/bin/env bash -e
|
|
|
|
RBENV_VERSION="$1"
|
|
VERSION_FILE=".rbenv-version"
|
|
if [ -z "$RBENV_VERSION" ]; then
|
|
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
|
|
|
|
echo "$RBENV_VERSION" > "$VERSION_FILE"
|
|
fi
|
|
|