mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-20 02:37:12 +03:00
18 lines
563 B
Plaintext
18 lines
563 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
# Check that all files embedded with file-embed are declared in extra-source-files
|
||
|
|
||
|
set -e
|
||
|
echo "Checking embedded file declarations:"
|
||
|
mapfile -t embeddedfiles < <(rg --sort=path '^ +\$\(embedFileRelative "([^"]+)"' -or '$1' -I)
|
||
|
status=0
|
||
|
for f in "${embeddedfiles[@]}"; do
|
||
|
if output=$(rg --sort=path -l "$f" -- */package.yaml); then
|
||
|
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
|