aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/assembly
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2016-09-14 17:59:22 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2016-09-15 11:57:51 +0200
commit7a0e70b84e3d3b97dca3db1381d6c64905b9ea6b (patch)
treed198b37fd3c711f56299bf1e2368986442b7f0d6 /src/main/assembly
parent89fac82713095f2ff85703fb6223a02e4b5b818d (diff)
downloadsonar-scanner-cli-7a0e70b84e3d3b97dca3db1381d6c64905b9ea6b.tar.gz
sonar-scanner-cli-7a0e70b84e3d3b97dca3db1381d6c64905b9ea6b.zip
SQSCANNER-27 Home not detected when links are used
Diffstat (limited to 'src/main/assembly')
-rwxr-xr-xsrc/main/assembly/bin/sonar-runner8
-rwxr-xr-xsrc/main/assembly/bin/sonar-scanner8
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"`/..