summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Torre <torreemanuele6@gmail.com>2020-05-28 21:03:55 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-29 07:59:45 +0200
commitd963be795d0e66348fa2e1b2d6bd00cf3dcb1d70 (patch)
tree47de7d1a8770b08618585248be18efb64ced2231
parent937d0be76219cb2d382f360c32bc970c859da065 (diff)
downloadserenity-d963be795d0e66348fa2e1b2d6bd00cf3dcb1d70.zip
Meta: update lint-shell-scripts.sh so that it does not search in Build/
We now use git-ls-files(1) instead of find(1).
-rwxr-xr-xMeta/lint-shell-scripts.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/Meta/lint-shell-scripts.sh b/Meta/lint-shell-scripts.sh
index ddb4ccf114..26495c2696 100755
--- a/Meta/lint-shell-scripts.sh
+++ b/Meta/lint-shell-scripts.sh
@@ -6,19 +6,19 @@ cd "$script_path/.."
ERRORS=()
-for f in $(find . -path ./Root -prune -o \
- -path ./Ports -prune -o \
- -path ./.git -prune -o \
- -path ./Toolchain -prune -o \
- -type f | sort -u); do
+while IFS= read -r f; do
if file "$f" | grep --quiet shell; then
{
shellcheck "$f" && echo -e "[\033[0;32mOK\033[0m]: sucessfully linted $f"
} || {
ERRORS+=("$f")
}
-fi
-done
+ fi
+done < <(git ls-files -- \
+ '*.sh' \
+ ':!:Toolchain' \
+ ':!:Ports' \
+)
if (( ${#ERRORS[@]} )); then
echo "Files failing shellcheck: ${ERRORS[*]}"