From 57d9548b841fac422d780d0159e7046118eab8bc Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 6 Feb 2023 17:39:01 +0100 Subject: [PATCH] apply: make sure each stage starts off back from the repo root dir the apply.sh script should assume current directory is arbitrary after executing each step: base, bitcoin, lnd and so on. this commit simply changes current dir to the repo root before executing every step. --- apply.sh | 5 +++++ update.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/apply.sh b/apply.sh index 2c3e4d3..948cbfb 100755 --- a/apply.sh +++ b/apply.sh @@ -3,15 +3,20 @@ # it must be run as root or a user with equivalent privileges. exit_code=0 +# defined in the caller script +rootdir="$SYSUPDATES_ROOTDIR" # base os +cd "$rootdir" ./base/voidlinux.sh || exit 1 # bitcoin core +cd "$rootdir" . ./btc/env bitcoin_apply || exit_code=$? # lnd lightning +cd "$rootdir" . ./lnd/env lnd_apply || exit_code=$? diff --git a/update.sh b/update.sh index 01d0a5d..2c927f1 100755 --- a/update.sh +++ b/update.sh @@ -46,6 +46,7 @@ if [ $? -ne 0 ]; then fi # run repo's update script +export SYSUPDATES_ROOTDIR="$REPODIR" export SYSUPDATES_CHANNEL="$BRANCH" ./apply.sh >> $LOGFILE 2>&1 if [ $? -ne 0 ]; then