Skip to content

Commit 60a6f48

Browse files
Make sed command work on Linux and Mac
1 parent e7be3c1 commit 60a6f48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ generate-protobuf-tests: $(BIN)/buf ## Regenerate protobuf gencode used in unit
4646
# generate cel-spec into test/gen/cel/expr
4747
$(BIN)/buf generate buf.build/google/cel-spec:$(CEL_SPEC_VERSION) --exclude-path cel/expr/conformance/proto2 --exclude-path cel/expr/conformance/proto3
4848
# we need to update the `from cel.expr` imports in those generated files to `from test.gen.cel.expr`
49-
LC_ALL=C find test/gen/cel -type f -exec sed -i "" 's/from cel.expr/from test.gen.cel.expr/g' {} +
49+
LC_ALL=C find test/gen/cel -type f -exec sed -i .bak 's/from cel.expr/from test.gen.cel.expr/g' {} + && find test/gen/cel -name '*.bak' -delete
5050

5151
# generate proto/tests/example/v1/validations.proto into test/gen/tests/example/v1
5252
$(BIN)/buf generate
@@ -59,7 +59,7 @@ generate-protovalidate-pypi-package: $(BIN)/buf ## Regenerate protobuf gencode
5959
cd bufbuild-protovalidate-protocolbuffers && ../$(BIN)/buf generate buf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION)
6060

6161
# set the version of bufbuild-protovalidate-protocolbuffers to the used PROTOVALIDATE_VERSION
62-
sed -i '' 's/^version = "[^"]*"/version = "$(PROTOVALIDATE_VERSION)"/' bufbuild-protovalidate-protocolbuffers/pyproject.toml
62+
sed -i .bak 's/^version = "[^"]*"/version = "$(PROTOVALIDATE_VERSION)"/' bufbuild-protovalidate-protocolbuffers/pyproject.toml && rm bufbuild-protovalidate-protocolbuffers/pyproject.toml.bak
6363

6464
.PHONY: format
6565
format: install $(BIN)/buf $(BIN)/license-header ## Format code

0 commit comments

Comments
 (0)