From 3dc6be35c1a1829c2394149f0645dd427f427bc5 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Sun, 19 Apr 2020 12:53:07 -0400 Subject: [PATCH] Tasks can access config (either local or global) --- git-build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-build.sh b/git-build.sh index 550d4cc..bbeecc0 100755 --- a/git-build.sh +++ b/git-build.sh @@ -12,7 +12,7 @@ run() { p_name="$1" echo "[$p_name] RUN" # Run in background and redirect output to $p_name.log - (GITBUILDDIR="$BASEDIR" nohup $BASEDIR/$p_name $p_name > $BASEDIR/$p_name.log 2> $BASEDIR/$p_name.err) & + (GITBUILDCONF="$CONFDIR" GITBUILDDIR="$BASEDIR" nohup $BASEDIR/$p_name $p_name > $BASEDIR/$p_name.log 2> $BASEDIR/$p_name.err) & } # So scripts can know we're still running (for autoupdater) @@ -28,6 +28,9 @@ for folder in $BASEDIR/*/; do [[ "$(basename $folder)" != "config" ]] && LOCAL=0 && break done +# Pass either local or global config to the task +[[ LOCAL = 1 ]] && CONFDIR=$BASEDIR/config || CONFDIR="$BASEDIR/$HOSTNAME" + # Find targeted projects from args PROJECTS=() for arg in "$@"; do