mirror of https://github.com/jenv/jenv.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
540 B
24 lines
540 B
#!/usr/bin/env bash |
|
set -e |
|
[ -n "$JENV_DEBUG" ] && set -x |
|
|
|
# Provide jenv completions |
|
if [ "$1" = "--complete" ]; then |
|
echo --unset |
|
echo system |
|
exec jenv-versions --bare |
|
fi |
|
|
|
JENV_VERSION="$1" |
|
JENV_VERSION_FILE=".jenv-version" |
|
|
|
if [ "$JENV_VERSION" = "--unset" ]; then |
|
rm -f "$JENV_VERSION_FILE" |
|
elif [ -n "$JENV_VERSION" ]; then |
|
jenv-version-file-write "$JENV_VERSION_FILE" "$JENV_VERSION" |
|
else |
|
jenv-version-file-read "$JENV_VERSION_FILE" || |
|
{ echo "jenv: no local version configured for this directory" |
|
exit 1 |
|
} >&2 |
|
fi
|
|
|