Skip to content

Commit

Permalink
[chore] Add for-all make target (#10522)
Browse files Browse the repository at this point in the history
Same as we have in contrib. Sometimes it's helpful to run a specific
command in all modules not just a make target. For example, `CMD="go mod
edit -replace
go.opentelemetry.io/otel/sdk/metric=../opentelemetry-go/sdk/metric" make
for-all` to debug go library issues.
  • Loading branch information
dmitryax authored Jul 3, 2024
1 parent b0f95ea commit cd639e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ gotest-with-cover:
goporto: $(PORTO)
$(PORTO) -w --include-internal --skip-dirs "^cmd/mdatagen/third_party$$" ./

.PHONY: for-all
for-all:
@echo "running $${CMD} in root"
@$${CMD}
@set -e; for dir in $(GOMODULES); do \
(cd "$${dir}" && \
echo "running $${CMD} in $${dir}" && \
$${CMD} ); \
done

.PHONY: golint
golint:
@$(MAKE) for-all-target TARGET="lint"
Expand Down

0 comments on commit cd639e5

Please sign in to comment.