summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-09-10 13:43:47 +0100
committerLeah Rowe <leah@libreboot.org>2026-09-10 13:49:34 +0100
commite9735841230c199029fae80d25caca13e9533c6d (patch)
tree54397a4bdb116df5dd375f43fa422f3db6a24637 /mk
parentafdf8c7733f81ca196c70a40566ec75111c31c33 (diff)
mk: generalised dispatch loop
with this new function, i can turn commands on and off by virtue of config. for now, behaviour is unchanged, but this new design means i will be able to disable certain commands in child processes Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'mk')
-rwxr-xr-xmk19
1 files changed, 4 insertions, 15 deletions
diff --git a/mk b/mk
index 78d2a603..286e24f9 100755
--- a/mk
+++ b/mk
@@ -35,26 +35,15 @@ main()
cmd=""
if [ $# -gt 0 ]; then
cmd="$1"
-
shift 1
fi
- case "$cmd" in
- version)
- printf "%s\nWebsite: %s\n" "$relname" "$projectsite"
- ;;
- release|download|inject|prep_mr_import)
- $cmd "$@"
- ;;
- -*)
+ if ! xeq main "$cmd" \
+ version release download inject prep_mr_import; then
return 0
- ;;
- *)
- err "bad command" main "$@"
- ;;
- esac
+ fi
- # some commands disable them. turn them back on!
+ $cmd "$@"
set -u -e
return 1