mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
lbmk: simplify execute_command()
if ./build command options fails, it just means that lbmk would next check whether ./buildpath mode list exists, which it never will because that would violate lbmk design. the generic "help" output is more than sufficient, and tells the user to check "list" anyway, so there's no point in saying it here. simplify this function. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -93,20 +93,14 @@ install_packages()
|
|||||||
|
|
||||||
execute_command()
|
execute_command()
|
||||||
{
|
{
|
||||||
case "${option}" in
|
if [ "${option}" = "list" ]; then
|
||||||
list)
|
./build command options "${buildpath}/${mode}"
|
||||||
./build command options "${buildpath}/${mode}" ;;
|
lbmk_exit 0
|
||||||
*)
|
elif [ ! -f "${buildpath}/${mode}/${option}" ]; then
|
||||||
if [ ! -d "${buildpath}/${mode}" ]; then
|
fail "Invalid command. Run: ${linkpath} help"
|
||||||
usage $0
|
else
|
||||||
fail "Invalid mode '${mode}'. Run: ${0} help"
|
|
||||||
elif [ ! -f "${buildpath}/${mode}/${option}" ]; then
|
|
||||||
usage $0
|
|
||||||
printf "Invalid option for '%s'." ${mode} 1>&2
|
|
||||||
fail "Run: ${0} ${mode} list'."
|
|
||||||
fi
|
|
||||||
"${buildpath}/${mode}/${option}" $@ || fail "lbmk error"
|
"${buildpath}/${mode}/${option}" $@ || fail "lbmk error"
|
||||||
esac
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
|
|||||||
Reference in New Issue
Block a user