makefile: fail rpc-check after finding any changes

`rpc-check` is used in our CI pipeline to detect any difference
between the committed and the automatically generated rpc files.
Unfortunately, the current method only detects changes in the
already existing files and won't fail if `make rpc` generates
a totally new file.

`git status --porcelain` makes the trick, it returns a line for
each file that has been modified, created or deleted.
This commit is contained in:
positiveblue
2022-01-26 22:52:03 -08:00
parent 9e0f7e73db
commit 3c3bce3415
2 changed files with 5 additions and 1 deletions

View File

@@ -280,7 +280,7 @@ rpc-format:
rpc-check: rpc
@$(call print, "Verifying protos.")
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
if test -n "$$(git status --porcelain)"; then echo "Protos not properly formatted or not compiled with v3.4.0"; git status; git diff; exit 1; fi
rpc-js-compile:
@$(call print, "Compiling JSON/WASM stubs.")