scripts: declare ROOT closer to where it's used, and some DRY changes

This also prevents shellcheck from complaining about a possibly
undefined variable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-07-20 12:10:37 +02:00
parent dba0ef4eb5
commit 6c257552a7
5 changed files with 12 additions and 7 deletions

View File

@@ -22,7 +22,10 @@ set -o errexit
set -o nounset
set -o pipefail
source "$(dirname "${BASH_SOURCE[0]}")/build-utils.sh"
basedir="$(dirname "${BASH_SOURCE[0]}")"
source "${basedir}/build-utils.sh"
ROOT="$( cd "${basedir}" && pwd )"/..
cd "${ROOT}"
# Make sure output directory is clean.