Skip to content

Commit b004a85

Browse files
authored
Remove -printf parameter from find (#67)
1 parent 8ab981e commit b004a85

38 files changed

+147
-116
lines changed

Makefile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
$(VERBOSE).SILENT:
22
############################# Main targets #############################
33
# Install everything, update submodule, and compile proto files.
4-
install: grpc-install mockgen-install update-proto
4+
install: grpc-install mockgen-install goimports-install update-proto
55

66
# Compile proto files.
7-
proto: grpc grpc-mock copyright
7+
proto: grpc grpc-mock goimports copyright
88

99
# Update submodule and compile proto files.
10-
update-proto: update-proto-submodule update-dependencies proto gomodtidy
10+
update-proto: update-proto-submodule proto update-dependencies gomodtidy
1111
########################################################################
1212

1313
##### Variables ######
@@ -29,11 +29,10 @@ PROTO_IMPORT := $(PROTO_ROOT):$(GOPATH)/src/github.com/temporalio/gogo-protobuf/
2929
$(PROTO_OUT):
3030
mkdir $(PROTO_OUT)
3131

32-
# git submodule for proto files
33-
32+
##### git submodule for proto files #####
3433
update-proto-submodule:
3534
printf $(COLOR) "Update proto-submodule..."
36-
git submodule update --force --remote $(PROTO_ROOT)
35+
git submodule update --init --force --remote $(PROTO_ROOT)
3736

3837
##### Compile proto files for go #####
3938
grpc: gogo-grpc fix-path
@@ -58,9 +57,13 @@ grpc-mock:
5857
printf $(COLOR) "Generate gRPC mocks..."
5958
$(foreach PROTO_GRPC_SERVICE,$(PROTO_GRPC_SERVICES),cd $(PROTO_OUT) && mockgen -package $(call service_name,$(PROTO_GRPC_SERVICE))mock -source $(PROTO_GRPC_SERVICE) -destination $(call mock_file_name,$(PROTO_GRPC_SERVICE))$(NEWLINE) )
6059

60+
goimports:
61+
@printf $(COLOR) "Run goimports..."
62+
@goimports -w $(PROTO_OUT)
63+
6164
##### Plugins & tools #####
6265
grpc-install: gogo-protobuf-install
63-
printf $(COLOR) "Installing/updating gRPC plugins..."
66+
printf $(COLOR) "Install/update gRPC plugins..."
6467
GO111MODULE=off go get -u google.golang.org/grpc
6568

6669
gogo-protobuf-install: go-protobuf-install
@@ -70,9 +73,13 @@ go-protobuf-install:
7073
GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go
7174

7275
mockgen-install:
73-
printf $(COLOR) "Installing/updating mockgen..."
76+
printf $(COLOR) "Install/update mockgen..."
7477
GO111MODULE=off go get -u github.com/golang/mock/mockgen
7578

79+
goimports-install:
80+
printf $(COLOR) "Install/update goimports..."
81+
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports
82+
7683
##### License header #####
7784
copyright:
7885
printf $(COLOR) "Update license headers..."
@@ -91,4 +98,4 @@ gomodtidy:
9198
clean:
9299
printf $(COLOR) "Deleting generated go files..."
93100
# Delete all directories with *.pb.go and *.mock.go files from $(PROTO_OUT)
94-
$(foreach PROTO_OUT_DIR,$(shell find $(PROTO_OUT) \( -name "*.pb.go" -o -name "*.mock.go" \) -printf "%h\n" | sort -u),rm -rf $(dir $(PROTO_OUT_DIR)) )
101+
find $(PROTO_OUT) \( -name "*.pb.go" -o -name "*.mock.go" \) | xargs dirname | sort -u | xargs rm -rf

command/v1/message.pb.go

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/v1/message.pb.go

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dependencies/gogoproto/gogo.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/command_type.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/common.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/event_type.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/failed_cause.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/namespace.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/query.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)