From 5a628e44b1cfb5b414f4116864f4838e3e652b41 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Tue, 23 Jan 2024 12:13:17 -0500 Subject: [PATCH] fix: source `tsch` environment file from anywhere (#45) --- environ.csh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/environ.csh b/environ.csh index d115cf4..9aadf46 100644 --- a/environ.csh +++ b/environ.csh @@ -1,5 +1,15 @@ #!/bin/tcsh +set this_cmd=($_) +set this_dir=`dirname ${this_cmd[2]}` +setenv QADB `cd ${this_dir} && pwd -P` -setenv QADB `pwd -P` -setenv JYPATH "${QADB}/src/" -env|grep --color -w JYPATH +set src_dir=${QADB}/src/ +if (! $?JYPATH) then + setenv JYPATH $src_dir +else + if ("$JYPATH" == "") then + setenv JYPATH $src_dir + else + setenv JYPATH $src_dir\:$JYPATH + endif +endif