aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/main/assembly/bin/sonar-runner17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/assembly/bin/sonar-runner b/src/main/assembly/bin/sonar-runner
index 9ba40c4..21c120a 100755
--- a/src/main/assembly/bin/sonar-runner
+++ b/src/main/assembly/bin/sonar-runner
@@ -9,16 +9,21 @@
if [ -z "$SONAR_RUNNER_HOME" ] ; then
PRG="$0"
+ # try to resolve symlinks
+ if [ `command -v readlink >/dev/null 2>&1; echo $?` -eq 0 ] ; then
+ PRG=`readlink -f "$PRG"`
+ fi
+
SONAR_RUNNER_HOME=`dirname "$PRG"`/..
# make it fully qualified
SONAR_RUNNER_HOME=`cd "$SONAR_RUNNER_HOME" && pwd`
-else
- # check that the SONAR_RUNNER_HOME has been correctly set
- if [ ! -e "$SONAR_RUNNER_HOME/lib/sonar-runner-${project.version}.jar" ] ; then
- echo '$SONAR_RUNNER_HOME' does not point to a valid installation directory: $SONAR_RUNNER_HOME
- exit 0
- fi
+fi
+
+# check that the SONAR_RUNNER_HOME has been correctly set
+if [ ! -e "$SONAR_RUNNER_HOME/lib/sonar-runner-${project.version}.jar" ] ; then
+ echo '$SONAR_RUNNER_HOME' does not point to a valid installation directory: $SONAR_RUNNER_HOME
+ exit 1
fi
JAVA_CMD="`which java`"