diff options
author | Ivan Zorin <[email protected]> | 2023-08-09 01:47:25 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-09 08:47:25 +1000 |
commit | d5035bb9563c6eec8c8cc3ac61a428602dc9f2ab (patch) | |
tree | 8cfc8ccdfd4a78e7a501c1766d217380f3ddb9c9 | |
parent | c0f1c35ba5f31928b50a80e1d4b2376e55f0b8cf (diff) | |
download | IronOS-d5035bb9563c6eec8c8cc3ac61a428602dc9f2ab.tar.gz IronOS-d5035bb9563c6eec8c8cc3ac61a428602dc9f2ab.zip |
Update build.sh to pass shellcheck checks (#1789)
source/build.sh: update according to shellcheck recommendations
-rwxr-xr-x | source/build.sh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/source/build.sh b/source/build.sh index 902618c5..be284183 100755 --- a/source/build.sh +++ b/source/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e TRANSLATION_DIR="../Translations" #TRANSLATION_SCRIPT="make_translation.py" @@ -91,14 +91,10 @@ while getopts "h:l:m:" option; do usage ;; l) - set -f - IFS=' ' - largs=($OPTARG) + IFS=' ' read -r -a largs <<< "${OPTARG}" ;; m) - set -f - IFS=' ' - margs=($OPTARG) + IFS=' ' read -r -a margs <<< "${OPTARG}" ;; *) usage @@ -124,7 +120,7 @@ if ((${#largs[@]})); then done echo "" fi -if [ -z "$BUILD_LANGUAGES" ]; then +if [ -z "${BUILD_LANGUAGES[*]}" ]; then echo " No custom languages selected." echo " Building: [ALL LANGUAGES]" BUILD_LANGUAGES+=("${AVAILABLE_LANGUAGES[@]}") @@ -137,11 +133,11 @@ echo " ${AVAILABLE_MODELS[*]}" echo -n "Requested models : " if ((${#margs[@]})); then for i in "${margs[@]}"; do - + if [[ "$i" != "Pinecil" ]] && [[ "$i" != "Pinecilv2" ]]; then # Dirty. Need to adapt the Build process to use upper cases only i=$(echo "${i}" | tr '[:lower:]' '[:upper:]') fi - + if isInArray "$i" "${AVAILABLE_MODELS[@]}"; then echo -n "$i " BUILD_MODELS+=("$i") @@ -152,7 +148,7 @@ if ((${#margs[@]})); then echo "" fi -if [ -z "$BUILD_MODELS" ]; then +if [ -z "${BUILD_MODELS[*]}" ]; then echo " No custom models selected." echo " Building: [ALL MODELS]" BUILD_MODELS+=("${AVAILABLE_MODELS[@]}") |