Skip to content

Commit

Permalink
Makefile: fix error from test
Browse files Browse the repository at this point in the history
When running make test, there appears an error:

	/bin/sh: 1: test: go test -exec sudo: unexpected operator

or

	/bin/sh: line 1: test: go test -exec sudo: binary operator expected

(depending on which shell is used).

This is caused by CMD value containing extra quotes (from
RUN_VIA_SUDO=-exec "sudo -n") which test sees as an extra option.

Enclose test argument in single quotes to fix the issue.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Oct 18, 2024
1 parent e9445a4 commit 48631b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ clean:

.PHONY: foreach
foreach: ## Run $(CMD) for every package.
@if test -z "$(CMD)"; then \
@if test -z '$(CMD)'; then \
echo 'Usage: make foreach CMD="commands to run for every package"'; \
exit 1; \
fi
Expand Down

0 comments on commit 48631b5

Please sign in to comment.