From 742415239740dedf456e18baea4ef295359b2730 Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Wed, 28 Feb 2024 11:00:42 -0800 Subject: [PATCH] Check env before using it. When the TARGET env variable is not set, the script will fail to run. This patchset add the check and ouput useful hints. Change-Id: I5167afca9352b5bdc7d96dbe7e9ef25e2e2db69e Signed-off-by: Baohua Yang Signed-off-by: Baohua Yang --- ci/scripts/create_binary_package.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/scripts/create_binary_package.sh b/ci/scripts/create_binary_package.sh index 4e74775063a..bc4e621a35d 100755 --- a/ci/scripts/create_binary_package.sh +++ b/ci/scripts/create_binary_package.sh @@ -4,6 +4,11 @@ # SPDX-License-Identifier: Apache-2.0 set -euo pipefail +# Check TARGET is non-empty +if [[ -z "$TARGET" ]]; then + echo "Error: TARGET is not set." + exit 1 +fi make "release/${TARGET}" mkdir -p "release/${TARGET}/config"