From ba3dfc5f52b61e23e851fabc94f446316648b463 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 15 Apr 2023 18:03:24 -0500 Subject: [PATCH] refactor: Move direnv hooks to .hooks --- dot_hooks.tmpl | 4 ++++ executable_dot_bashrc.tmpl | 6 ------ executable_dot_zshrc.tmpl | 6 ------ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dot_hooks.tmpl b/dot_hooks.tmpl index 757e684..565dc5a 100644 --- a/dot_hooks.tmpl +++ b/dot_hooks.tmpl @@ -17,6 +17,10 @@ if [ -f "$HOME/miniconda3/etc/profile.d/mamba.sh" ]; then fi # <<< conda initialize <<< +{{- if lookPath "direnv" }} +eval "$(direnv hook $(basename $0))" +{{- end }} + if [ -f $HOME/.ion/bin/ion ]; then export PATH="$HOME/.ion/bin/ion:$PATH" export FPATH="$HOME/.ion/completions:$FPATH" diff --git a/executable_dot_bashrc.tmpl b/executable_dot_bashrc.tmpl index 732a3b7..aac0dde 100644 --- a/executable_dot_bashrc.tmpl +++ b/executable_dot_bashrc.tmpl @@ -11,12 +11,6 @@ source $HOME/.hooks # User specific aliases and functions source $HOME/.aliases -# >>> direnv initalize >>> -if [ $(command -v direnv) ]; then - eval "$(direnv hook bash)" -fi -# <<< direnv initalize <<< - source $HOME/.envvar if [ $(command -v env_parallel.bash) ]; then diff --git a/executable_dot_zshrc.tmpl b/executable_dot_zshrc.tmpl index bedc10e..734a0de 100644 --- a/executable_dot_zshrc.tmpl +++ b/executable_dot_zshrc.tmpl @@ -54,12 +54,6 @@ COMPLETION_WAITING_DOTS="true" source $HOME/.hooks -# >>> direnv initalize >>> -if [ $(command -v direnv) ]; then - eval "$(direnv hook zsh)" -fi -# <<< direnv initalize <<< - # Tell Antigen that you're done antigen apply