Add direnv-hook to promp if exists

Buddy Sandidge 8 years ago
parent ba22ecdc80
commit 2f17161f59

@ -0,0 +1,11 @@
#!/usr/bin/env bash
_direnv_hook() {
eval "$(direnv export bash)";
};
if type direnv > /dev/null; then
if ! [[ "$PROMPT_COMMAND" =~ _direnv_hook ]]; then
PROMPT_COMMAND="_direnv_hook;$PROMPT_COMMAND";
fi
fi

@ -43,3 +43,7 @@ fi
if [ -f ~/.bash/prompt ]; then if [ -f ~/.bash/prompt ]; then
source ~/.bash/prompt source ~/.bash/prompt
fi fi
if [ -f ~/.bash/direnv-hook ]; then
source ~/.bash/direnv-hook
fi

Loading…
Cancel
Save