From 62dfdd85d49f3d5177bfff75a7245011bc5a18ff Mon Sep 17 00:00:00 2001 From: Leander van Dinteren Date: Mon, 18 Nov 2019 12:41:38 +0100 Subject: [PATCH] Export base directory before loading config file to allow using base dir within config --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a730e44..7f7b64b 100755 --- a/build.sh +++ b/build.sh @@ -122,6 +122,7 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi +export BASE_DIR=${BASE_DIR:-"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"} if [ -f config ]; then # shellcheck disable=SC1091 @@ -154,7 +155,6 @@ export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}" export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}"}" export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}"}" -BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export SCRIPT_DIR="${BASE_DIR}/scripts" export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}" export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}