build: properly add check-rest-annotations.sh

The builds fails otherwise. The Makefile has also been modified to use
the proper path here.
This commit is contained in:
Olaoluwa Osuntokun
2023-06-14 20:12:35 -05:00
parent fa51fd5d8a
commit 520e40dedc
2 changed files with 12 additions and 1 deletions

View File

@@ -121,7 +121,7 @@ rpc-format:
rpc-check: rpc rpc-check: rpc
@$(call print, "Verifying protos.") @$(call print, "Verifying protos.")
cd ./pricesrpc; ../scripts/check-rest-annotations.sh cd ./pricesrpc; ../pricesrpc/check-rest-annotations.sh
if test -n "$$(git status --porcelain)"; then echo "Protos not properly formatted or not compiled with correct version"; git status; git diff; exit 1; fi if test -n "$$(git status --porcelain)"; then echo "Protos not properly formatted or not compiled with correct version"; git status; git diff; exit 1; fi
clean: clean:

View File

@@ -0,0 +1,11 @@
#!/bin/bash
for proto in $(find . -name "*.proto"); do
for rpc in $(awk '/ rpc /{print $2}' "$proto"); do
yaml=${proto%%.proto}.yaml
if ! grep -q "$rpc" "$yaml"; then
echo "RPC $rpc not added to $yaml file"
exit 1
fi
done
done