Skip to content

Commit

Permalink
macos does not have sed --in-place argument (#12330)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jul 13, 2024
1 parent 1eb6e22 commit c4f7a72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/generate_proto_stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ rm -rf "$TMP_DIR"
# Must be in a git repository to run pre-commit
cd "$REPO_ROOT"

sed --in-place="" \

This comment has been minimized.

Copy link
@Avasam

Avasam Aug 11, 2024

Collaborator

@sobolevn This then breaks Linux because -i must not be followed by "" there >.<

This comment has been minimized.

Copy link
@sobolevn

sobolevn Aug 11, 2024

Author Member

😱

posix bash is hard!

sed -i "" \
"s/extra_description = .*$/extra_description = \"\
Partially generated using [mypy-protobuf==$MYPY_PROTOBUF_VERSION](https:\/\/github.com\/nipunn1313\/mypy-protobuf\/tree\/v$MYPY_PROTOBUF_VERSION) \
and $PROTOC_VERSION \
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_s2clientprotocol_protobuf_stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rm -rf "$TMP_DIR"
# Must be in a git repository to run pre-commit
cd "$REPO_ROOT"

sed --in-place="" \
sed -i "" \
"s/extra_description = .*$/extra_description = \"\
Partially generated using [mypy-protobuf==$MYPY_PROTOBUF_VERSION](https:\/\/github.com\/nipunn1313\/mypy-protobuf\/tree\/v$MYPY_PROTOBUF_VERSION) \
and $PROTOC_VERSION \
Expand Down
6 changes: 3 additions & 3 deletions scripts/sync_tensorflow_protobuf_stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ cd "$REPO_ROOT"

# Move third-party and fix imports
mv stubs/tensorflow/tsl/ stubs/tensorflow/tensorflow/
find stubs/tensorflow/ -name '*_pb2.pyi' | xargs sed --in-place="" -r "s/(\[|\s)tsl\./\1tensorflow\.tsl\./"
find stubs/tensorflow/ -name '*_pb2.pyi' | xargs sed -i "" -r "s/(\[|\s)tsl\./\1tensorflow\.tsl\./"
mv stubs/tensorflow/xla/ stubs/tensorflow/tensorflow/compiler/
find stubs/tensorflow/ -name '*_pb2.pyi' | xargs sed --in-place="" -r "s/(\[|\s)xla\./\1tensorflow\.compiler\.xla\./"
find stubs/tensorflow/ -name '*_pb2.pyi' | xargs sed -i "" -r "s/(\[|\s)xla\./\1tensorflow\.compiler\.xla\./"

# These protos exist in a folder with protos used in python,
# but are not included in the python wheel.
Expand All @@ -89,7 +89,7 @@ rm -r \
stubs/tensorflow/tensorflow/core/protobuf/worker_service_pb2.pyi \
stubs/tensorflow/tensorflow/core/util/example_proto_fast_parsing_test_pb2.pyi \

sed --in-place="" \
sed -i "" \
"s/extra_description = .*$/extra_description = \"\
Partially generated using [mypy-protobuf==$MYPY_PROTOBUF_VERSION](https:\/\/github.com\/nipunn1313\/mypy-protobuf\/tree\/v$MYPY_PROTOBUF_VERSION) \
and $PROTOC_VERSION \
Expand Down

0 comments on commit c4f7a72

Please sign in to comment.