diff options
author | Mark Rekveld <mark.rekveld@sonarsource.com> | 2020-09-24 08:29:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 08:29:18 +0200 |
commit | 4a8d1e3fda2a772671383ac6f6201a6b97605ac1 (patch) | |
tree | a94504cdaea34e69dfb9b14328f31e1431f5f25e /misc | |
parent | 31dca6f1920a3468794a93e04b8dff30673e31e4 (diff) | |
download | sonar-scanner-cli-4a8d1e3fda2a772671383ac6f6201a6b97605ac1.tar.gz sonar-scanner-cli-4a8d1e3fda2a772671383ac6f6201a6b97605ac1.zip |
SQSCANNER-78 - backtick syntax (#83)
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/symlink-tester.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/symlink-tester.sh b/misc/symlink-tester.sh index bab955e..8ef5791 100755 --- a/misc/symlink-tester.sh +++ b/misc/symlink-tester.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh usage() { echo usage: $0 path/to/sonar-scanner @@ -10,10 +10,10 @@ test -f "$1" && test -x "$1" || usage scanner=$1 if type mktemp &>/dev/null; then - tempdir=$(mktemp -d) - tempdir=$(cd "$tempdir"; pwd -P) + tempdir=`mktemp -d` + tempdir=`cd "$tempdir"; pwd -P` else - tempdir=/tmp/"$(basename "$0")-$$" + tempdir=/tmp/"`basename "$0"`-$$" mkdir -p "$tempdir" fi @@ -25,7 +25,7 @@ trap 'cleanup; exit 1' 1 2 3 15 trap 'cleanup; exit 0' 0 abspath() { - (cd "$(dirname "$1")"; echo $PWD/"$(basename "$1")") + (cd "`dirname "$1"`"; echo $PWD/"`basename "$1"`") } verify() { @@ -46,10 +46,10 @@ relpath_to_root() { ) } -ln -s "$(abspath "$scanner")" "$tempdir"/scanner +ln -s "`abspath "$scanner"`" "$tempdir"/scanner verify 'launch from abs symlink to abs path' "$tempdir"/scanner -h -ln -s "$(relpath_to_root "$tempdir")$(abspath "$scanner")" "$tempdir"/scanner-rel +ln -s "`relpath_to_root "$tempdir"``abspath "$scanner"`" "$tempdir"/scanner-rel verify 'symlink to rel path is valid' test -e "$tempdir"/scanner-rel verify 'launch from abs symlink to rel path' "$tempdir"/scanner-rel -h |