From 9bc59794138b4340a091aabb5c2046d7e9f2204e Mon Sep 17 00:00:00 2001 From: Sean Fitzgerald <1220713+Fitzse@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:41:23 -0800 Subject: [PATCH] fix check-clean make target --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b51ae5..4b8335a 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ generate: cd tools; go generate check-clean: - @git diff --exit-code || (echo "\033[0;31mWorking directory is not clean - did you run 'make generate' and commit the changes?" && exit 1) + @if [ -n "$$(git status --porcelain)" ]; then \ + echo "\033[0;31mWorking directory is not clean - did you run 'make generate' and commit the changes?"; \ + exit 1; \ + fi .PHONY: install build test lint generate check-clean test-acc