From e4956478dbf2bee395d0847c03c3149567388156 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 16 May 2024 11:34:31 +0100 Subject: [PATCH] build: remove initcmd() and simplify main() Signed-off-by: Leah Rowe --- build | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/build b/build index 7fbc505..b7ea635 100755 --- a/build +++ b/build @@ -36,22 +36,14 @@ main() git_err "git config --global user.email \"john.doe@example.com\"" git_init - initcmd $@ - - [ -f "${spath}" ] || $err "Bad command. Check $projectname docs." - shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}" - - xbmk_exit 0 -} - -initcmd() -{ [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" case "${1}" in version) printf "%s\n" "$relname" ;; release) shift 1; mkrelease $@ ;; - *) return 0 ;; + *) + [ -f "${spath}" ] || $err "Bad command. Check docs." + shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}" ;; esac xbmk_exit 0 }