From be48c89689b9a8d3abb8dd8fe0f7e35f64b5cf30 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 15 Apr 2023 19:31:22 -0500 Subject: [PATCH] fix: Replace $0 with more robust shell checker --- dot_hooks.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dot_hooks.tmpl b/dot_hooks.tmpl index 29097e0..a025c71 100644 --- a/dot_hooks.tmpl +++ b/dot_hooks.tmpl @@ -1,6 +1,6 @@ # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! -__conda_setup="$($HOME/miniconda3/bin/conda shell.$(basename $0) 'hook' 2> /dev/null)" +__conda_setup="$($HOME/miniconda3/bin/conda shell.$(basename $(readlink -f /proc/$$/exe)) 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else @@ -18,7 +18,7 @@ fi # <<< conda initialize <<< {{- if lookPath "direnv" }} -eval "$(direnv hook $(basename $0))" +eval "$(direnv hook $(basename $(readlink -f /proc/$$/exe)))" {{- end }} if [ -f $HOME/.ion/bin/ion ]; then @@ -27,8 +27,8 @@ if [ -f $HOME/.ion/bin/ion ]; then fi # Import GNU parallel -if [ $(command -v env_parallel.$(basename $0)) ]; then - source $(which env_parallel.$(basename $0)) +if [ $(command -v env_parallel.$(basename $(readlink -f /proc/$$/exe))) ]; then + source $(which env_parallel.$(basename $(readlink -f /proc/$$/exe))) fi {{- if eq .machinetype "workstation" }}