build: remove excmd() and simplify main()

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-05-16 11:23:22 +01:00
parent b76a70c3f9
commit 5702f5a4dc
1 changed files with 7 additions and 10 deletions

17
build
View File

@ -26,6 +26,7 @@ main()
{ {
x_ id -u 1>/dev/null 2>/dev/null x_ id -u 1>/dev/null 2>/dev/null
[ $# -lt 1 ] && $err "Check $projectname documentation for help." [ $# -lt 1 ] && $err "Check $projectname documentation for help."
spath="script/$1"
[ "$1" = "dependencies" ] && x_ install_packages $@ && xbmk_exit 0 [ "$1" = "dependencies" ] && x_ install_packages $@ && xbmk_exit 0
@ -36,9 +37,12 @@ main()
git config --global user.email 1>/dev/null 2>/dev/null || \ git config --global user.email 1>/dev/null 2>/dev/null || \
git_err "git config --global user.email \"john.doe@example.com\"" git_err "git config --global user.email \"john.doe@example.com\""
for cmd in initcmd git_init excmd; do initcmd $@
eval "${cmd} \$@" git_init
done
[ -f "${spath}" ] || $err "Bad command. Check $projectname docs."
shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}"
xbmk_exit 0 xbmk_exit 0
} }
@ -92,13 +96,6 @@ git_init()
$err "${PWD}: cannot git-tag ${projectname}/${version}" $err "${PWD}: cannot git-tag ${projectname}/${version}"
} }
excmd()
{
spath="script/${1}"
[ -f "${spath}" ] || $err "Bad command. Check $projectname docs."
shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}"
}
mkrelease() mkrelease()
{ {
export XBMK_RELEASE="y" export XBMK_RELEASE="y"