forked from pyenv/pyenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yamashita Yuu
committed
Aug 15, 2013
1 parent
403f4eb
commit 93b5368
Showing
7 changed files
with
128 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function __fish_pyenv | ||
pyenv commands | ||
end | ||
|
||
complete -f -c pyenv -a '(__fish_pyenv)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
[ -n "$PYENV_DEBUG" ] && set -x | ||
|
||
# Provide pyenv completions | ||
if [ "$1" = "--complete" ]; then | ||
exec pyenv-rehash --complete | ||
fi | ||
|
||
# When pyenv shell integration is enabled, delegate to pyenv-rehash, | ||
# then tell the shell to empty its command lookup cache. | ||
pyenv-rehash | ||
# FIXME: support fish | ||
#echo "hash -r" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Summary: Set or show the shell-specific Python version | ||
# | ||
# Usage: pyenv shell <version> | ||
# pyenv shell --unset | ||
# | ||
# Sets a shell-specific Python version by setting the `PYENV_VERSION' | ||
# environment variable in your shell. This version overrides local | ||
# application-specific versions and the global version. | ||
# | ||
# <version> should be a string matching a Python version known to pyenv. | ||
# The special version string `system' will use your default system Python. | ||
# Run `pyenv versions' for a list of available Python versions. | ||
|
||
set -e | ||
[ -n "$PYENV_DEBUG" ] && set -x | ||
|
||
# Provide pyenv completions | ||
if [ "$1" = "--complete" ]; then | ||
echo --unset | ||
echo system | ||
exec pyenv-versions --bare | ||
fi | ||
|
||
versions=("$@") | ||
|
||
if [ -z "$versions" ]; then | ||
if [ -z "$PYENV_VERSION" ]; then | ||
echo "pyenv: no shell-specific version configured" >&2 | ||
exit 1 | ||
else | ||
echo "echo \"\$PYENV_VERSION\"" | ||
exit | ||
fi | ||
fi | ||
|
||
if [ "$versions" = "--unset" ]; then | ||
echo "set -e PYENV_VERSION" | ||
exit | ||
fi | ||
|
||
# Make sure the specified version is installed. | ||
if pyenv-prefix "${versions[@]}" >/dev/null; then | ||
OLDIFS="$IFS" | ||
IFS=: PYENV_VERSION="${versions[*]}" | ||
IFS="OLDIFS" | ||
echo "setenv PYENV_VERSION \"${PYENV_VERSION}\"" | ||
else | ||
echo "false" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters