;tools:checkembeddedfiles: use standard unix tools

rg isn't in github images
This commit is contained in:
Simon Michael 2025-06-13 18:14:35 -10:00
parent 6b19f24c5f
commit 9cd633ace6

View File

@ -2,13 +2,11 @@
# Check that all files embedded with file-embed are declared in extra-source-files # Check that all files embedded with file-embed are declared in extra-source-files
set -e set -e
rg="rg --sort=path"
$rg --version >/dev/null
echo "Checking embedded file declarations:" echo "Checking embedded file declarations:"
status=0 status=0
for f in $($rg -I '\$\(embedFile[^ ]* "([^"]+)"' -or '$1'); do for f in $(find . -name '*.hs' | xargs grep -E '\$\(embedFile' | sed -E 's/.*\$\(embedFile[^ ]* "([^"]+)".*/\1/'); do
if output=$($rg -l "$f" -- */package.yaml); then if output=$(grep -l "$f" -- */package.yaml); then
printf '%-40s\tdeclared in %s\n' "$f" "$output" printf '%-40s\tdeclared in %s\n' "$f" "$output"
else else
printf '%-40s\tUNDECLARED\n' "$f" printf '%-40s\tUNDECLARED\n' "$f"