Skip to content

Commit

Permalink
make+scripts: fix rpc-check command
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Jul 27, 2021
1 parent 4a0025c commit 36a316e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ rpc-format:

rpc-check: rpc
@$(call print, "Verifying protos.")
for rpc in $$(find lnrpc/ -name "*.proto" | $(XARGS) awk '/ rpc /{print $$2}'); do if ! grep -q $$rpc lnrpc/rest-annotations.yaml; then echo "RPC $$rpc not added to lnrpc/rest-annotations.yaml"; exit 1; fi; done
cd ./lnrpc; ../scripts/check-rest-annotations.sh
if test -n "$$(git describe --dirty | grep dirty)"; then echo "Protos not properly formatted or not compiled with v3.4.0"; git status; git diff; exit 1; fi

sample-conf-check:
Expand Down
11 changes: 11 additions & 0 deletions scripts/check-rest-annotations.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 36a316e

Please sign in to comment.