;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
|
# 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:"
|
||||||
mapfile -t embeddedfiles < <(rg --sort=path '^ +\$\(embedFileRelative "([^"]+)"' -or '$1' -I)
|
# shellcheck disable=SC2016
|
||||||
|
mapfile -t embeddedfiles < <($rg -I '^ +\$\(embedFileRelative "([^"]+)"' -or '$1')
|
||||||
status=0
|
status=0
|
||||||
for f in "${embeddedfiles[@]}"; do
|
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"
|
printf '%-40s\tdeclared in %s\n' "$f" "$output"
|
||||||
else
|
else
|
||||||
printf '%-40s\tUNDECLARED\n' "$f"
|
printf '%-40s\tUNDECLARED\n' "$f"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user