diff options
author | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2021-02-25 15:14:18 +0530 |
---|---|---|
committer | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2021-02-25 22:28:26 +0530 |
commit | 5aaa6c91edeb66068c3ada48a30a077208b595b7 (patch) | |
tree | fdce52741df89ad5c9d50409116f8e02f6aeabd4 /jenkins-helpers.sh | |
parent | 8e1130ba33528252ddabb266069c36dda56d4b30 (diff) |
Error if value is not provided for '==arr[key]'.
Currently, the script gives error $2 is unbound, if value is not
passed. The patch modifies it to emit an error and exit.
Change-Id: I7a63d510edca4e96a49833fb6e965d14ccb6f52c
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r-- | jenkins-helpers.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 129aeef9..3f33359d 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -914,6 +914,10 @@ EOF declare -gA $arr EOF fi + if [ $# -lt 2 ]; then + echo "ERROR: Parameter value not provided for $1." + exit 1 + fi eval "$name=\"$2\"" cat <<EOF | manifest_out $name="$2" |