From 80d3ee3c7822581104d8cab32eac2ee9a4c4e6bf Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 17 Oct 2024 10:19:26 +0100 Subject: [PATCH] ci/shellcheck: Don't overwrite SCRIPTS_DIR with relative path shellcheck doesn't like it when we have relative paths and it's trying to check if the files exist. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/run-shellcheck.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci/run-shellcheck.sh b/.gitlab-ci/run-shellcheck.sh index 2b1d0852b80..a445b7b6693 100755 --- a/.gitlab-ci/run-shellcheck.sh +++ b/.gitlab-ci/run-shellcheck.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash -CHECKPATH=".gitlab-ci" -export SCRIPTS_DIR="${CHECKPATH}" +SCRIPTS_DIR="$(realpath "$(dirname "$0")")" is_bash() { [[ $1 == *.sh ]] && return 0 @@ -21,4 +20,4 @@ while IFS= read -r -d $'' file; do exit 1 fi fi -done < <(find $CHECKPATH -type f \! -path "./.git/*" -print0) +done < <(find "$SCRIPTS_DIR" -type f \! -path "./.git/*" -print0)