Created
May 28, 2020 19:56
-
-
Save progrium/ea7cba82a90ac0d06fb2517e21761013 to your computer and use it in GitHub Desktop.
zsh hook to automatically source/"unsource" directories with .devrc
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
autoload -U add-zsh-hook | |
load-devrc() { | |
if [[ -f .devrc && -r .devrc ]]; then | |
source .devrc | |
else | |
if typeset -f devrc-unset > /dev/null; then | |
devrc-unset | |
unset -f devrc-unset | |
fi | |
fi | |
} | |
add-zsh-hook chpwd load-devrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment