build: Fixed issue in sourcetrail.sh Linux script (issue #638)

This commit is contained in:
Eberhard Graether
2018-12-06 18:08:40 +01:00
parent b47a0b5b72
commit c7cc70c22e
Regular → Executable
+4 -3
View File
@@ -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 )"