mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 21:40:33 +00:00
faa3bf195a
Making this work in the absence of bash is more cumbersome than simply skipping it at the moment.
27 lines
620 B
Bash
Executable file
27 lines
620 B
Bash
Executable file
#!/bin/bash
|
|
set -e pipefail
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
cd "$script_path/.."
|
|
|
|
ERRORS=()
|
|
|
|
for f in $(find . -path ./Root -prune -o \
|
|
-path ./Ports -prune -o \
|
|
-path ./.git -prune -o \
|
|
-path ./Toolchain -prune -o \
|
|
-path ./Libraries/LibJS/Tests -prune -o \
|
|
-type f | sort -u); do
|
|
if file "$f" | grep --quiet shell; then
|
|
{
|
|
shellcheck "$f" && echo -e "[\033[0;32mOK\033[0m]: sucessfully linted $f"
|
|
} || {
|
|
ERRORS+=("$f")
|
|
}
|
|
fi
|
|
done
|
|
|
|
if (( ${#ERRORS[@]} )); then
|
|
echo "Files failing shellcheck: ${ERRORS[*]}"
|
|
exit 1
|
|
fi
|