Add -f/--force rebuild when no updates are available
This commit is contained in:
parent
23ef11c2a3
commit
6131357494
12
git-build.sh
12
git-build.sh
|
@ -18,11 +18,16 @@ run() {
|
||||||
# So scripts can know we're still running (for autoupdater)
|
# So scripts can know we're still running (for autoupdater)
|
||||||
touch $BASEDIR/.LOCK
|
touch $BASEDIR/.LOCK
|
||||||
|
|
||||||
|
FORCE=0
|
||||||
|
|
||||||
# Find targeted projects from args
|
# Find targeted projects from args
|
||||||
PROJECTS=()
|
PROJECTS=()
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
[ -f $BASEDIR/$arg.source ] && PROJECTS+=("$arg")
|
if [[ "$arg" = "-f" ]] || [[ "$arg" = "--force" ]]; then
|
||||||
# use elseif to match other arguments, so we can do else print arg not found
|
FORCE=1
|
||||||
|
elif [ -f $BASEDIR/$arg.source ]; then
|
||||||
|
PROJECTS+=("$arg")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If no project argument passed, default to all projects
|
# If no project argument passed, default to all projects
|
||||||
|
@ -61,6 +66,9 @@ for p_name in ${PROJECTS[*]}; do
|
||||||
git pull --quiet --recurse-submodules
|
git pull --quiet --recurse-submodules
|
||||||
[[ $? != 0 ]] && echo "[$p_name] PULL FAILED" && exit 1
|
[[ $? != 0 ]] && echo "[$p_name] PULL FAILED" && exit 1
|
||||||
run $p_name
|
run $p_name
|
||||||
|
# If no update was found, we can still force rebuild with -f/--force
|
||||||
|
elif [[ $FORCE = 1 ]]; then
|
||||||
|
run $p_name
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue