trees: don't continue if no argument given

main() used to be the only function executed from
outside of main(), in this script, but now we source
a config file and then run the build afterward.

when a flag is provided without OPTARG, this means
that we are continuing such action erroneously. to
mitigate this, return 1 in that instance, and handle
it in the line that calls main(), making it exit with
zero status (success).

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-07-11 00:28:32 +01:00 committed by Leah Rowe
parent 3365fca06a
commit 60d491e2bd
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ main()
./update trees $_f "$p" || $err "!./update trees $_f $p" ./update trees $_f "$p" || $err "!./update trees $_f $p"
[ "$XBMK_RELEASE" != "y" ] || singletree "$p" || \ [ "$XBMK_RELEASE" != "y" ] || singletree "$p" || \
x_ rm -Rf "src/$p/$p"; continue x_ rm -Rf "src/$p/$p"; continue
done && return 0 done && return 1
[ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined" [ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined"
@ -253,6 +253,6 @@ copy_elf()
done < "$listfile"; x_ make clean -C "$srcdir" done < "$listfile"; x_ make clean -C "$srcdir"
} }
main $@ main $@ || exit 0
. "$mkhelpercfg" . "$mkhelpercfg"
$cmd $cmd