build: remove initcmd() and simplify main()

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-05-16 11:34:31 +01:00 committed by Leah Rowe
parent f2b3bb142d
commit e4956478db
1 changed files with 3 additions and 11 deletions

14
build
View File

@ -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
}