mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
;dev:tools:checkembeddedfiles: fail when rg is not installed
This commit is contained in:
parent
a6d3424e0b
commit
7bbda90e2c
@ -2,11 +2,15 @@
|
||||
# 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:"
|
||||
mapfile -t embeddedfiles < <(rg --sort=path '^ +\$\(embedFileRelative "([^"]+)"' -or '$1' -I)
|
||||
# shellcheck disable=SC2016
|
||||
mapfile -t embeddedfiles < <($rg -I '^ +\$\(embedFileRelative "([^"]+)"' -or '$1')
|
||||
status=0
|
||||
for f in "${embeddedfiles[@]}"; do
|
||||
if output=$(rg --sort=path -l "$f" -- */package.yaml); then
|
||||
if output=$($rg -l "$f" -- */package.yaml); then
|
||||
printf '%-40s\tdeclared in %s\n' "$f" "$output"
|
||||
else
|
||||
printf '%-40s\tUNDECLARED\n' "$f"
|
||||
|
Loading…
Reference in New Issue
Block a user