From 61313574948473313c9d6132d0b08e096db8f115 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Sun, 19 Apr 2020 08:42:48 -0400 Subject: [PATCH] Add -f/--force rebuild when no updates are available --- git-build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/git-build.sh b/git-build.sh index 6d2e1bf..88ba019 100755 --- a/git-build.sh +++ b/git-build.sh @@ -18,11 +18,16 @@ run() { # So scripts can know we're still running (for autoupdater) touch $BASEDIR/.LOCK +FORCE=0 + # Find targeted projects from args PROJECTS=() for arg in "$@"; do - [ -f $BASEDIR/$arg.source ] && PROJECTS+=("$arg") - # use elseif to match other arguments, so we can do else print arg not found + if [[ "$arg" = "-f" ]] || [[ "$arg" = "--force" ]]; then + FORCE=1 + elif [ -f $BASEDIR/$arg.source ]; then + PROJECTS+=("$arg") + fi done # If no project argument passed, default to all projects @@ -61,6 +66,9 @@ for p_name in ${PROJECTS[*]}; do git pull --quiet --recurse-submodules [[ $? != 0 ]] && echo "[$p_name] PULL FAILED" && exit 1 run $p_name + # If no update was found, we can still force rebuild with -f/--force + elif [[ $FORCE = 1 ]]; then + run $p_name fi done