diff --git a/setup/Linux/Sourcetrail.sh b/setup/Linux/Sourcetrail.sh old mode 100644 new mode 100755 index ce5f1b8e..0365d01a --- a/setup/Linux/Sourcetrail.sh +++ b/setup/Linux/Sourcetrail.sh @@ -5,9 +5,10 @@ SOURCE="${0}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - if [ "$SOURCE" != /* ]; then - SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - fi + case $SOURCE in # if $SOURCE is a relative symlink, we need to resolve it relative to the path where the symlink file was located + /*) ;; + *) SOURCE="$DIR/$SOURCE" ;; + esac done SOURCETRAIL_PATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"