summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-05-16 11:34:31 +0100
committerLeah Rowe <leah@libreboot.org>2024-05-16 11:34:53 +0100
commitdd851caac9078b621bc03f59f7735bcbbd2e9fb1 (patch)
tree9912163ffc64f4cbfc6436fca1b5e7dafec3069d /build
parent4ea843a4903a618f216e7f5aa8306f67afd327c6 (diff)
build: remove initcmd() and simplify main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'build')
-rwxr-xr-xbuild14
1 files changed, 3 insertions, 11 deletions
diff --git a/build b/build
index a48e3061..565d0ffa 100755
--- a/build
+++ b/build
@@ -38,16 +38,6 @@ 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
@@ -55,7 +45,9 @@ initcmd()
release) shift 1; mkrelease $@ ;;
inject) shift 1; vendor_inject $@ ;;
download) shift 1; vendor_download $@ ;;
- *) return 0 ;;
+ *)
+ [ -f "${spath}" ] || $err "Bad command. Check docs."
+ shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}" ;;
esac
set -u -e # some commands disable them. turn them on!
xbmk_exit 0