Skip to content

Instantly share code, notes, and snippets.

@LarsFronius
Created May 12, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LarsFronius/4d3167dfd0df168d2ab50576e3ebd315 to your computer and use it in GitHub Desktop.
Save LarsFronius/4d3167dfd0df168d2ab50576e3ebd315 to your computer and use it in GitHub Desktop.
Rehash pyenv on every invocation of a shimmed executable
#!/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