From 566072896f894e8e49e84bf15781ed6727baf0c2 Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Mon, 7 Jun 2021 09:53:44 +0200 Subject: Move direnv hook to bashrc. --- .bashrc | 12 ++++++++++++ .config/blue032.profile | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.bashrc b/.bashrc index 5d15aa2..40db5eb 100644 --- a/.bashrc +++ b/.bashrc @@ -17,3 +17,15 @@ complete -D -F _completion_loader -o bashdefault -o default # Load if available [ -f ~/.fzf.bash ] && . ~/.fzf.bash [ -f ~/.config/broot/launcher/bash/br ] && . ~/.config/broot/launcher/bash/br + +# direnv hook +_direnv_hook() { + local previous_exit_status=$?; + trap -- '' SIGINT; + eval "$("/usr/bin/direnv" export bash)"; + trap - SIGINT; + return $previous_exit_status; +}; +if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then + PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}" +fi diff --git a/.config/blue032.profile b/.config/blue032.profile index b759bfd..e69de29 100644 --- a/.config/blue032.profile +++ b/.config/blue032.profile @@ -1,11 +0,0 @@ - -_direnv_hook() { - local previous_exit_status=$?; - trap -- '' SIGINT; - eval "$("/usr/bin/direnv" export bash)"; - trap - SIGINT; - return $previous_exit_status; -}; -if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then - PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}" -fi -- cgit v1.2.3