From 57abeb1af549bcc25b0e8f71fd0dc35b03483a8f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 8 Oct 2021 21:20:22 +0200 Subject: [PATCH] Makefile: avoid spurious error messge on first run My first run of "make test" gave me this harmless error make[1]: Entering directory '/home/johannes/git/lab' rm coverage-* 2>&1 > /dev/null || true rm: cannot remove 'coverage-*': No such file or directory The redirections are meant to silence the error but fail because "> /dev/null" does not change the earlier redirection of stderr to stdout. It would work if written as ">/dev/null 2>&1". Even better, let's just use "rm -f", then we don't need to check the exit code either. Signed-off-by: Johannes Altmanninger --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c0f2fd4d..9ba2338a 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ test: bash -c "trap 'trap - SIGINT SIGTERM ERR; mv testdata/.git testdata/test.git; rm coverage-* 2>&1 > /dev/null; exit 1' SIGINT SIGTERM ERR; $(MAKE) internal-test" internal-test: - rm coverage-* 2>&1 > /dev/null || true + rm -f coverage-* GO111MODULE=on go test -coverprofile=coverage-main.out -covermode=count -coverpkg ./... -run=$(run) $(GOURL)/cmd $(GOURL)/internal/... go get -u github.com/wadey/gocovmerge gocovmerge coverage-*.out > coverage.txt && rm coverage-*.out