mirror of
https://github.com/pyenv/pyenv.git
synced 2025-12-22 06:01:28 +09:00
Co-authored-by: Ivan Pozdeev <ivan_pozdeev@mail.ru> Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
30 lines
569 B
Bash
Executable File
30 lines
569 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
# Provide pyenv completions
|
|
if [ "$1" = "--complete" ]; then
|
|
exec pyenv-rehash --complete
|
|
fi
|
|
|
|
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
|
|
|
|
# When pyenv shell integration is enabled, delegate to pyenv-rehash,
|
|
# then tell the shell to empty its command lookup cache.
|
|
case "$shell" in
|
|
pwsh)
|
|
echo "& (get-command pyenv -commandtype application) rehash"
|
|
;;
|
|
*)
|
|
echo "command pyenv rehash"
|
|
esac
|
|
|
|
case "$shell" in
|
|
fish | pwsh )
|
|
# no executable cache
|
|
;;
|
|
* )
|
|
echo "hash -r 2>/dev/null || true"
|
|
;;
|
|
esac
|