diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-18 10:21:54 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-18 10:21:54 +0100 |
commit | 1a062bb62810ba555351a01bb17f74e3beb992a8 (patch) | |
tree | 59159c2e61afdd184ccdf0cadf6e65b81de6e10f /build | |
parent | a212a5bec8c7cc95bc836695f8973c17cb30dba4 (diff) |
build: reduce code to less than 80 chars per line
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'build')
-rwxr-xr-x | build | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -2,7 +2,7 @@ # 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, 2016 Klemens Nanni <contact@autoboot.org> # Copyright (C) 2022, Caleb La Grange <thonkpeasant@protonmail.com> @@ -54,7 +54,7 @@ help() { Example: ./build roms withgrub Example: ./build clean all - Refer to the ${projectname} documentation for more information. + Refer to ${projectname} documentation for more info. EOF } @@ -64,7 +64,7 @@ die() { } if [ $# -lt 1 ]; then - die "Wrong number of arguments specified. See './build help'." + die "Wrong argument count. Run: ./build help" fi mode="${1}" @@ -81,27 +81,27 @@ if [ $# -gt 1 ]; then shift 2 case "${option}" in - list) - printf "Available options for mode '%s':\n\n" "${mode}" - listoptions "${mode}" - ;; - all) - for option in $(listoptions "${mode}"); do - "${build}"/"${mode}"/"${option}" $@ - done - ;; - *) - if [ -d "${build}"/"${mode}"/ ]; then - if [ -f "${build}"/"${mode}"/"${option}" ]; then - "${build}"/"${mode}"/"${option}" $@ - else - help - die "Invalid option for '${mode}'. See './build ${mode} list'." - fi - else - help - die "Invalid mode '${mode}'. See './build help'." - fi + list) + printf "Options for mode '%s':\n\n" ${mode} + listoptions "${mode}" + ;; + all) + for option in $(listoptions "${mode}"); do + "${build}"/"${mode}"/"${option}" $@ + done + ;; + *) + if [ ! -d "${build}"/"${mode}"/ ]; then + help + die "Invalid mode '${mode}'. Run: ./build help" + fi + if [ -f "${build}"/"${mode}"/"${option}" ]; then + "${build}"/"${mode}"/"${option}" $@ + else + help + printf "Invalid option for '%s'." ${mode} + die "Run: ./build ${mode} list'." + fi esac else help |