From c2c160f7b48d6e673bdb9bb07a6d3a84ca89d57a Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Thu, 3 Sep 2026 17:07:32 +0100 Subject: [PATCH] ci/kas-container-shell-helper: fix help We should first check for the mandatory script argument before using it. Signed-off-by: Jose Quaresma --- ci/kas-container-shell-helper.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ci/kas-container-shell-helper.sh b/ci/kas-container-shell-helper.sh index fb825d02f..4c12d55e6 100755 --- a/ci/kas-container-shell-helper.sh +++ b/ci/kas-container-shell-helper.sh @@ -3,12 +3,21 @@ # SPDX-License-Identifier: MIT TOPDIR=$(realpath $(dirname $(readlink -f $0))/..) -SCRIPT=$(realpath $1) -if ! [ -f $SCRIPT ]; then +_help(){ echo "The script path argument is missing, please run it with:" echo " $0 /path/to/script" exit 1 +} + +if [ -z "$1" ] ; then + _help +fi + +SCRIPT=$(realpath $1) + +if ! [ -f "$SCRIPT" ]; then + _help fi # make it relative to the TOPDIR