| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | set -e |
| 3 | [scip-shell system . . `[`. -n "$PYENV_DEBUG" ] && set -x |
| 4 | |
| 5 | # Provide pyenv completions |
| 6 | if [scip-shell system . . `[`. "$1" = "--complete" ]; then |
| 7 | exec pyenv-rehash --complete |
| 8 | fi |
| 9 | |
| 10 | shell="$(basenamescip-shell system . . basename. "${PYENV_SHELL:-$SHELL}")" |
| 11 | |
| 12 | # When pyenv shell integration is enabled, delegate to pyenv-rehash, |
| 13 | # then tell the shell to empty its command lookup cache. |
| 14 | case "$shell" in |
| 15 | pwsh) |
| 16 | echoscip-shell system . . echo. "& (get-command pyenv -commandtype application) rehash" |
| 17 | ;; |
| 18 | *) |
| 19 | echoscip-shell system . . echo. "command pyenv rehash" |
| 20 | esac |
| 21 | |
| 22 | case "$shell" in |
| 23 | fish | pwsh ) |
| 24 | # no executable cache |
| 25 | ;; |
| 26 | * ) |
| 27 | echoscip-shell system . . echo. "hash -r 2>/dev/null || true" |
| 28 | ;; |
| 29 | esac |