2023-06-02 20:49:18 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Check that all files embedded with file-embed are declared in extra-source-files
|
|
|
|
|
|
|
|
set -e
|
2023-06-03 00:08:40 +03:00
|
|
|
rg="rg --sort=path"
|
|
|
|
$rg --version >/dev/null
|
|
|
|
|
2023-06-02 20:49:18 +03:00
|
|
|
echo "Checking embedded file declarations:"
|
|
|
|
status=0
|
2023-06-15 08:51:12 +03:00
|
|
|
for f in $($rg -I '^ +\$\(embedFileRelative "([^"]+)"' -or '$1'); do
|
2023-06-03 00:08:40 +03:00
|
|
|
if output=$($rg -l "$f" -- */package.yaml); then
|
2023-06-02 20:49:18 +03:00
|
|
|
printf '%-40s\tdeclared in %s\n' "$f" "$output"
|
|
|
|
else
|
|
|
|
printf '%-40s\tUNDECLARED\n' "$f"
|
|
|
|
status=1
|
|
|
|
fi;
|
|
|
|
done
|
|
|
|
if [[ $status != 0 ]]; then echo FAIL; else echo ok; fi
|
|
|
|
exit $status
|