aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanos Gyerik <janos@kronos>2017-07-07 23:37:39 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2017-08-02 09:55:02 +0200
commit06f92ea39d23dfa3109b7fcccab12f0a6e5e6ef3 (patch)
tree2bfda97e27f34b2274aa6739cf4439a1b4c27f56 /src
parent51bc742e575d45310852962625952f895a5cc24b (diff)
downloadsonar-scanner-cli-06f92ea39d23dfa3109b7fcccab12f0a6e5e6ef3.tar.gz
sonar-scanner-cli-06f92ea39d23dfa3109b7fcccab12f0a6e5e6ef3.zip
Simplify and modernize real_path
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main/assembly/bin/sonar-scanner13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/assembly/bin/sonar-scanner b/src/main/assembly/bin/sonar-scanner
index d6ffd57..dc9d263 100755
--- a/src/main/assembly/bin/sonar-scanner
+++ b/src/main/assembly/bin/sonar-scanner
@@ -14,22 +14,15 @@ real_path () {
while true; do
cd "$(dirname "$target")"
target=$(basename "$target")
- link=$(readlink "$target")
- test "$link" || break
- target=$link
+ test -L "$target" || break
+ target=$(readlink "$target")
done
echo "$(pwd -P)/$target"
)
}
-script_path="$0"
-
-if [ -h "$script_path" ] ; then
- # resolve recursively symlinks
- script_path=$(real_path "$script_path")
-fi
-
+script_path=$(real_path "$0")
sonar_scanner_home=$(dirname "$script_path")/..
# make it fully qualified