Add help flag, ensure sourceless task working dir (basedir)
This commit is contained in:
parent
ec926d76bc
commit
6938e47102
|
@ -62,7 +62,7 @@ debug () {
|
||||||
|
|
||||||
help () {
|
help () {
|
||||||
echo "forgebuild [tasks]"
|
echo "forgebuild [tasks]"
|
||||||
echo " Trigger updates on `tasks` (all tasks by default)"
|
echo " Trigger updates on \`tasks\` (all tasks by default)"
|
||||||
echo "ARGS:"
|
echo "ARGS:"
|
||||||
echo " -f: force run of tasks regardless of updates on the repository"
|
echo " -f: force run of tasks regardless of updates on the repository"
|
||||||
echo " -b BASEDIR: consider tasks from BASEDIR, not ~/.forgebuild"
|
echo " -b BASEDIR: consider tasks from BASEDIR, not ~/.forgebuild"
|
||||||
|
@ -248,6 +248,9 @@ for arg in "$@"; do
|
||||||
elif [[ "$arg" = "-f" ]] || [[ "$arg" = "--force" ]]; then
|
elif [[ "$arg" = "-f" ]] || [[ "$arg" = "--force" ]]; then
|
||||||
info force_flag
|
info force_flag
|
||||||
FORCE=1
|
FORCE=1
|
||||||
|
elif [[ "$arg" = "-h" ]] || [[ "$arg" = "--help" ]]; then
|
||||||
|
help
|
||||||
|
exit 0
|
||||||
elif [[ "$arg" = "-b" ]] || [[ "$arg" = "--basedir" ]]; then
|
elif [[ "$arg" = "-b" ]] || [[ "$arg" = "--basedir" ]]; then
|
||||||
FOUND_BASEDIR=1
|
FOUND_BASEDIR=1
|
||||||
elif [ -x $BASEDIR/$arg ]; then
|
elif [ -x $BASEDIR/$arg ]; then
|
||||||
|
@ -328,6 +331,7 @@ for p_name in ${PROJECTS[*]}; do
|
||||||
# If $p_name.done exists, the task was already run
|
# If $p_name.done exists, the task was already run
|
||||||
[ -f $BASEDIR/$p_name.done ] && continue
|
[ -f $BASEDIR/$p_name.done ] && continue
|
||||||
# If the task fails, don't register the .done
|
# If the task fails, don't register the .done
|
||||||
|
cd $BASEDIR
|
||||||
run $p_name && touch $BASEDIR/$p_name.done
|
run $p_name && touch $BASEDIR/$p_name.done
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue