Tasks can access config (either local or global)

This commit is contained in:
southerntofu 2020-04-19 12:53:07 -04:00
parent beca1ef2fe
commit 3dc6be35c1
1 changed files with 4 additions and 1 deletions

View File

@ -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