make profile path configurable as autodetection is too unprecise so far

This commit is contained in:
root
2023-04-19 21:15:33 +00:00
parent c2ca5f659c
commit 64fecf16fb

View File

@@ -80,7 +80,11 @@ pathappend ()
# ------------------------------------------------------------------------------
# Store script's path (realpath -s resolve symlinks if profile.sh is a symlink)
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)