From 814b19c60494e7a22ccf74bc7c6d24610c72d2ba Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sat, 12 Mar 2022 15:04:45 +0100 Subject: [PATCH] fix realpath --- packages/genpkg.sh | 11 ++++++++++- tests.sh | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/genpkg.sh b/packages/genpkg.sh index ad22087..080f0f3 100755 --- a/packages/genpkg.sh +++ b/packages/genpkg.sh @@ -15,7 +15,16 @@ up() } # pivot -cur=$(dirname "$(readlink -f "${0}")") +rl="readlink -f" +if ! ${rl} "${0}" >/dev/null 2>&1; then + rl="realpath" + + if ! hash ${rl}; then + echo "\"${rl}\" not found!" && exit 1 + fi +fi +# cur +cur=`dirname $(${rl} "${0}")` opwd=`pwd` pkgfile="PKGBUILD" cd ${cur} diff --git a/tests.sh b/tests.sh index adfee97..814de04 100755 --- a/tests.sh +++ b/tests.sh @@ -54,7 +54,15 @@ ${nosebin} --version export DOTDROP_FORCE_NODEBUG=yes # coverage file location -cur=`dirname $(readlink -f "${0}")` +rl="readlink -f" +if ! ${rl} "${0}" >/dev/null 2>&1; then + rl="realpath" + + if ! hash ${rl}; then + echo "\"${rl}\" not found!" && exit 1 + fi +fi +cur=`dirname $(${rl} "${0}")` workers=${DOTDROP_WORKERS} if [ ! -z ${workers} ]; then