diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-10 13:43:47 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-10 13:49:34 +0100 |
| commit | e9735841230c199029fae80d25caca13e9533c6d (patch) | |
| tree | 54397a4bdb116df5dd375f43fa422f3db6a24637 /mk | |
| parent | afdf8c7733f81ca196c70a40566ec75111c31c33 (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-x | mk | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -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 |
