mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 05:11:33 +03:00
20 lines
538 B
Bash
Executable File
20 lines
538 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Check that all files embedded with file-embed are declared in extra-source-files
|
|
|
|
set -e
|
|
rg="rg --sort=path"
|
|
$rg --version >/dev/null
|
|
|
|
echo "Checking embedded file declarations:"
|
|
status=0
|
|
for f in $($rg -I '^ +\$\(embedFileRelative "([^"]+)"' -or '$1'); do
|
|
if output=$($rg -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
|