1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:18:12 +00:00

Meta: Find potentially missing resources

This commit is contained in:
Ben Wiederhake 2020-07-27 06:33:48 +02:00 committed by Andreas Kling
parent 5692fa6c39
commit eccf96b703
3 changed files with 20 additions and 2 deletions

18
Meta/lint-missing-resources.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
set -e pipefail
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$script_path/.."
# The dollar symbol in sed's argument is for "end of line", not any shell variable.
# shellcheck disable=SC2016
grep -Pirh '(?<!file://)(?<!\.)(?<!})(?<!\()/(etc|res|usr|www)/' AK/ Applications/ Base Demos/ DevTools/ Documentation/ Games/ Kernel/ Libraries/ MenuApplets/ Services/ Shell/ Userland/ | \
sed -re 's,^.*["= `]/([^"%`: ]+[^"%`: /.])/?(["%`: .].*)?$,\1,' | \
sort -u | \
while read -r referenced_resource
do
if ! [ -r "Base/${referenced_resource}" ] && ! [ -r "Build/Root/${referenced_resource}" ]
then
echo "Potentially missing resource: ${referenced_resource}"
fi
done