From 7a0e70b84e3d3b97dca3db1381d6c64905b9ea6b Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Wed, 14 Sep 2016 17:59:22 +0200 Subject: SQSCANNER-27 Home not detected when links are used --- src/main/assembly/bin/sonar-runner | 8 ++++++-- src/main/assembly/bin/sonar-scanner | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/assembly/bin/sonar-runner b/src/main/assembly/bin/sonar-runner index 556e712..7c314f1 100755 --- a/src/main/assembly/bin/sonar-runner +++ b/src/main/assembly/bin/sonar-runner @@ -71,8 +71,12 @@ if [ -z "$SONAR_RUNNER_HOME" ] ; then PRG="$0" if [ -h "$PRG" ] ; then - # resolve symlinks - PRG=`real_path "$PRG"` + # resolve recursively symlinks + R_PRG=`real_path "$PRG"` + until [ "$R_PRG" = "$PRG" ]; do + PRG="$R_PRG" + R_PRG=`real_path "$PRG"` + done fi SONAR_RUNNER_HOME=`dirname "$PRG"`/.. diff --git a/src/main/assembly/bin/sonar-scanner b/src/main/assembly/bin/sonar-scanner index 1a25d3f..9108239 100755 --- a/src/main/assembly/bin/sonar-scanner +++ b/src/main/assembly/bin/sonar-scanner @@ -69,8 +69,12 @@ if [ -z "$SONAR_SCANNER_HOME" ] ; then PRG="$0" if [ -h "$PRG" ] ; then - # resolve symlinks - PRG=`real_path "$PRG"` + # resolve recursively symlinks + R_PRG=`real_path "$PRG"` + until [ "$R_PRG" = "$PRG" ]; do + PRG="$R_PRG" + R_PRG=`real_path "$PRG"` + done fi SONAR_SCANNER_HOME=`dirname "$PRG"`/.. -- cgit v1.2.3