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>
This commit is contained in:
Leah Rowe
2024-07-11 00:28:32 +01:00
parent 3263eeb6b6
commit e37779c11d
+2 -2
View File
@@ -40,7 +40,7 @@ main()
./update trees $_f "$p" || $err "!./update trees $_f $p"
[ "$XBMK_RELEASE" != "y" ] || singletree "$p" || \
x_ rm -Rf "src/$p/$p"; continue
done && return 0
done && return 1
[ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined"
@@ -253,6 +253,6 @@ copy_elf()
done < "$listfile"; x_ make clean -C "$srcdir"
}
main $@
main $@ || exit 0
. "$mkhelpercfg"
$cmd