From e888115d3f300a7161c0ff2704d13f48202bc672 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 7 Sep 2023 19:58:26 +0200 Subject: [PATCH] build.sh: assoiative arrays are available only since Bash 4 and MacOS is still on some Bash 3... --- firmware/build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/build.sh b/firmware/build.sh index 09e90fb..ea79b50 100755 --- a/firmware/build.sh +++ b/firmware/build.sh @@ -13,10 +13,13 @@ softdevice_id=0x0100 application_version=1 bootloader_version=1 -declare -A device_type_to_hw_version=( ["ultra"]="0" ["lite"]="1" ) - device_type=${CURRENT_DEVICE_TYPE:-ultra} -hw_version=${device_type_to_hw_version[$device_type]} +case $device_type in + "ultra") hw_version=0 ;; + "lite") hw_version=1 ;; + *) echo "Unknown CURRENT_DEVICE_TYPE $CURRENT_DEVICE_TYPE, aborting."; exit 1 ;; +esac + echo "Building firmware for $device_type (hw_version=$hw_version)" set -xe