Fix script path detection on macOS
authorCryptoManiac <balthazar.ad@gmail.com>
Thu, 30 Dec 2021 05:37:50 +0000 (08:37 +0300)
committerCryptoManiac <balthazar.ad@gmail.com>
Thu, 30 Dec 2021 05:37:50 +0000 (08:37 +0300)
share/genbuild.sh

index 0dff4ba..7eee927 100755 (executable)
@@ -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