pyenv/libexec/pyenv-sh-rehash
Florian Blanchet aeea3ac825
Add PowerShell support (#2749)
Co-authored-by: Ivan Pozdeev <ivan_pozdeev@mail.ru>
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2025-12-21 05:33:19 +03:00

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