Skip to content

Commit 50b07d5

Browse files
Make sed command work on Linux and Mac
1 parent 94c5dff commit 50b07d5

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
@@ -47,7 +47,7 @@ generate-protobuf-tests: $(BIN)/buf ## Regenerate protobuf gencode used in unit
4747
# generate cel-spec into test/gen/cel/expr
4848
$(BIN)/buf generate buf.build/google/cel-spec:$(CEL_SPEC_VERSION) --exclude-path cel/expr/conformance/proto2 --exclude-path cel/expr/conformance/proto3
4949
# we need to update the `from cel.expr` imports in those generated files to `from test.gen.cel.expr`
50-
LC_ALL=C find test/gen/cel -type f -exec sed -i "" 's/from cel.expr/from test.gen.cel.expr/g' {} +
50+
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
5151

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

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

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

0 commit comments

Comments
 (0)