mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 02:04:41 +08:00
460c2eb967
That way, IDEs get to have the same behaviour as the CI Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31826>
23 lines
490 B
Bash
Executable File
23 lines
490 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
SCRIPTS_DIR="$(realpath "$(dirname "$0")")"
|
|
|
|
is_bash() {
|
|
[[ $1 == *.sh ]] && return 0
|
|
[[ $1 == */bash-completion/* ]] && return 0
|
|
[[ $(file -b --mime-type "$1") == text/x-shellscript ]] && return 0
|
|
return 1
|
|
}
|
|
|
|
anyfailed=0
|
|
|
|
while IFS= read -r -d $'' file; do
|
|
if is_bash "$file" ; then
|
|
if ! shellcheck "$file"; then
|
|
anyfailed=1
|
|
fi
|
|
fi
|
|
done < <(find "$SCRIPTS_DIR" -type f \! -path "./.git/*" -print0)
|
|
|
|
exit "$anyfailed"
|