From 3b80a42aa01dd4a26a400193769bd039da241234 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sun, 6 Mar 2022 17:46:44 +0100 Subject: scripts: download: coreboot: fix ./download all When running ./download all, we have the following error: resources/scripts/download/coreboot: Line 52: $1 is not set. The ./download all command was broken by the following commit: 2bb805e2e07a7d3e1268a09d720ecd13e26af418 (download: Add --help in the individual download scripts). Reported-by: madbehaviorus[m] on #libreboot on liberachat Signed-off-by: Denis 'GNUtoo' Carikli --- resources/scripts/download/coreboot | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/scripts/download/coreboot b/resources/scripts/download/coreboot index b94b1bc9..21fe0781 100755 --- a/resources/scripts/download/coreboot +++ b/resources/scripts/download/coreboot @@ -49,10 +49,14 @@ usage() "Prints this help" } -if [ $# -eq 1 -a "$1" == "--help" ] ; then +# In this script, set -u is used to check for undefined variables, and +# the test command doesn't do any lazy evaluation, so we can't use +# a syntax like that: [ $# -eq 1 -a "$1" == "--help" ]. + +if [ $# -eq 1 ] && [ "$1" == "--help" ] ; then usage exit 0 -elif [ $# -eq 1 -a "$1" == "--list-boards" ] ; then +elif [ $# -eq 1 ] && [ "$1" == "--list-boards" ] ; then list_supported_boards exit 0 fi -- cgit v1.2.1