build: reduce code to less than 80 chars per line

Signed-off-by: Leah Rowe <leah@libreboot.org>
fsdg20230625
Leah Rowe 2023-05-18 10:21:54 +01:00
parent a212a5bec8
commit 1a062bb628
1 changed files with 24 additions and 24 deletions

48
build
View File

@ -2,7 +2,7 @@
# generic build script, for building components (all of them) # generic build script, for building components (all of them)
# #
# Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org> # Copyright (C) 2014,2015,2020,2021,2023 Leah Rowe <info@minifree.org>
# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net> # Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net>
# Copyright (C) 2015, 2016 Klemens Nanni <contact@autoboot.org> # Copyright (C) 2015, 2016 Klemens Nanni <contact@autoboot.org>
# Copyright (C) 2022, Caleb La Grange <thonkpeasant@protonmail.com> # Copyright (C) 2022, Caleb La Grange <thonkpeasant@protonmail.com>
@ -54,7 +54,7 @@ help() {
Example: ./build roms withgrub Example: ./build roms withgrub
Example: ./build clean all Example: ./build clean all
Refer to the ${projectname} documentation for more information. Refer to ${projectname} documentation for more info.
EOF EOF
} }
@ -64,7 +64,7 @@ die() {
} }
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then
die "Wrong number of arguments specified. See './build help'." die "Wrong argument count. Run: ./build help"
fi fi
mode="${1}" mode="${1}"
@ -81,27 +81,27 @@ if [ $# -gt 1 ]; then
shift 2 shift 2
case "${option}" in case "${option}" in
list) list)
printf "Available options for mode '%s':\n\n" "${mode}" printf "Options for mode '%s':\n\n" ${mode}
listoptions "${mode}" listoptions "${mode}"
;; ;;
all) all)
for option in $(listoptions "${mode}"); do for option in $(listoptions "${mode}"); do
"${build}"/"${mode}"/"${option}" $@ "${build}"/"${mode}"/"${option}" $@
done done
;; ;;
*) *)
if [ -d "${build}"/"${mode}"/ ]; then if [ ! -d "${build}"/"${mode}"/ ]; then
if [ -f "${build}"/"${mode}"/"${option}" ]; then help
"${build}"/"${mode}"/"${option}" $@ die "Invalid mode '${mode}'. Run: ./build help"
else fi
help if [ -f "${build}"/"${mode}"/"${option}" ]; then
die "Invalid option for '${mode}'. See './build ${mode} list'." "${build}"/"${mode}"/"${option}" $@
fi else
else help
help printf "Invalid option for '%s'." ${mode}
die "Invalid mode '${mode}'. See './build help'." die "Run: ./build ${mode} list'."
fi fi
esac esac
else else
help help