Created
May 12, 2017 14:44
-
-
Save LarsFronius/4d3167dfd0df168d2ab50576e3ebd315 to your computer and use it in GitHub Desktop.
Rehash pyenv on every invocation of a shimmed executable
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
#!/usr/bin/env bash | |
# Install this file into ${HOME}/.pyenv/plugins/pyenv-rehash/etc/pyenv.d/exec/rehash.bash | |
# | |
# Executes pyenv-rehash on invocation of any pyenv shimmed executable in ${HOME}/.pyenv/shims/ | |
set -e | |
# Remove pyenv-exec from $@ | |
shift 1 | |
STATUS=0 | |
"$PYENV_COMMAND_PATH" "$@" || STATUS="$?" | |
# Run `pyenv-rehash` after a successful installation. | |
if [ "$STATUS" == "0" ]; then | |
pyenv-rehash | |
fi | |
exit "$STATUS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment