From 64fecf16fb635451328f3b63ab53254fabfaab09 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Apr 2023 21:15:33 +0000 Subject: [PATCH] make profile path configurable as autodetection is too unprecise so far --- profile.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profile.sh b/profile.sh index 914bafc..fa1baf2 100644 --- a/profile.sh +++ b/profile.sh @@ -80,7 +80,11 @@ pathappend () # ------------------------------------------------------------------------------ # Store script's path (realpath -s resolve symlinks if profile.sh is a symlink) -export MYPATH=$(dirname $(realpath -s $0)) +if [[ -z $PROFILE_PATH ]]; then + export MYPATH=$(dirname $(realpath -s $0)) +else + export MYPATH=$PROFILE_PATH +fi if [[ ! -e $MYPATH/profile.sh ]]; then echo "[ Warning ] Path detection failed, using pwd..." MYPATH=$(pwd)