aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-05-20 16:02:35 +0200
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-05-20 16:02:35 +0200
commit77ae9c7a5d2d4c73647370aea360b5229d675d2f (patch)
tree7d06672c62cbf9dac5c19c2f36b3d717136a83cb
parent9bf2e62f70a66a1612db88415bf6371bd59163b7 (diff)
downloadsonar-scanner-cli-77ae9c7a5d2d4c73647370aea360b5229d675d2f.tar.gz
sonar-scanner-cli-77ae9c7a5d2d4c73647370aea360b5229d675d2f.zip
SONARPLUGINS-2862 Only resolve symlink target file when the executed file is an actual symlink
-rwxr-xr-xsonar-runner-dist/src/main/assembly/bin/sonar-runner6
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-runner-dist/src/main/assembly/bin/sonar-runner b/sonar-runner-dist/src/main/assembly/bin/sonar-runner
index 1658fcb..1140738 100755
--- a/sonar-runner-dist/src/main/assembly/bin/sonar-runner
+++ b/sonar-runner-dist/src/main/assembly/bin/sonar-runner
@@ -68,8 +68,10 @@ real_path () {
if [ -z "$SONAR_RUNNER_HOME" ] ; then
PRG="$0"
- # resolve symlinks
- PRG=`real_path "$PRG"`
+ if [ -h "$PRG" ] ; then
+ # resolve symlinks
+ PRG=`real_path "$PRG"`
+ fi
SONAR_RUNNER_HOME=`dirname "$PRG"`/..