[fix] don't use library functions before it's loaded

This commit is contained in:
2023-02-23 14:43:44 +01:00
parent fd984c4a16
commit 3248327e56

View File

@@ -82,15 +82,15 @@ pathappend ()
# Store script's path (realpath -s resolve symlinks if profile.sh is a symlink) # Store script's path (realpath -s resolve symlinks if profile.sh is a symlink)
export MYPATH=$(dirname $(realpath -s $0)) export MYPATH=$(dirname $(realpath -s $0))
if [[ ! -e $MYPATH/profile.sh ]]; then if [[ ! -e $MYPATH/profile.sh ]]; then
disp W "Path detection failed, using pwd..." echo "[ Warning ] Path detection failed, using pwd..."
MYPATH=$(pwd) MYPATH=$(pwd)
if [[ ! -e $MYPATH/profile.sh ]]; then if [[ ! -e $MYPATH/profile.sh ]]; then
disp E "Impossible to determine installation path, pretty much nothing will work." echo "[ Error ] Impossible to determine installation path, pretty much nothing will work."
fi fi
fi fi
if [[ ! -s $MYPATH/version ]]; then if [[ ! -s $MYPATH/version ]]; then
disp W "Impossible to determine running version of profile, your installation might be broken." echo "[ Warning ] Impossible to determine running version of profile, your installation might be broken."
fi fi
export PROFVERSION=$(cat $MYPATH/version) export PROFVERSION=$(cat $MYPATH/version)