From: user Date: Wed, 29 Dec 2021 05:18:45 +0000 (+0300) Subject: Fix genbuild.sh to allow configuring building outside of project root X-Git-Tag: nvc-v0.5.9~11 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=14f12399f3bffb937b63c94ed52371c01e786235 Fix genbuild.sh to allow configuring building outside of project root --- diff --git a/share/genbuild.sh b/share/genbuild.sh index d959877..8af3f1f 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -1,5 +1,9 @@ #!/bin/sh +PREVDIR=$(pwd) +SCRIPT=$(readlink -f $0) +SCRIPTPATH=`dirname $SCRIPT` + if [ $# -gt 0 ]; then FILE="$1" shift @@ -11,6 +15,8 @@ else exit 1 fi +cd $SCRIPTPATH + if [ -e "$(which git)" ]; then # clean 'dirty' status of touched files that haven't been modified git diff >/dev/null 2>/dev/null @@ -33,3 +39,5 @@ if [ "$INFO" != "$NEWINFO" ]; then echo "$NEWINFO" >"$FILE" echo "#define BUILD_DATE \"$TIME\"" >>"$FILE" fi + +cd $PREVDIR