From 60d491e2bd0878fd3e3fe928acd254b7305d9381 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 11 Jul 2024 00:28:32 +0100 Subject: [PATCH] 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 --- script/trees | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/trees b/script/trees index c468a1d..f1c0ace 100755 --- a/script/trees +++ b/script/trees @@ -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