From: CryptoManiac Date: Thu, 30 Dec 2021 05:37:50 +0000 (+0300) Subject: Fix script path detection on macOS X-Git-Tag: nvc-v0.5.10~36 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=37db5ac3c6caf124efef6f8efe3683803a94c7e6 Fix script path detection on macOS --- diff --git a/share/genbuild.sh b/share/genbuild.sh index 0dff4ba..7eee927 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -1,7 +1,11 @@ #!/bin/sh +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + PREVDIR=$(pwd) -SCRIPT=$(readlink -f $0) +SCRIPT=$(realpath $0) SCRIPTPATH=`dirname $SCRIPT` if [ $# -gt 0 ]; then