Skip to content

Commit 4a8e0b1

Browse files
committed
fix: proto compilation uses macos sed if platform is darwin
1 parent 3b47047 commit 4a8e0b1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/compile_proto.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ python -m grpc_tools.protoc \
1616
"$PROTO_DIR/athena/athena.proto"
1717

1818
# Fix imports in generated files
19-
sed -i "$OUT_DIR/athena/athena_pb2_grpc.py" -e 's/^from athena /from athena_client.generated.athena /'
20-
sed -i "$OUT_DIR/athena/athena_pb2.py" -e 's/^from athena /from athena_client.generated.athena /'
19+
if [[ "$OSTYPE" == "darwin"* ]]; then
20+
sed -i '' -e 's/^from athena /from athena_client.generated.athena /' "$OUT_DIR/athena/athena_pb2_grpc.py"
21+
sed -i '' -e 's/^from athena /from athena_client.generated.athena /' "$OUT_DIR/athena/athena_pb2.py"
22+
else
23+
sed -i -e 's/^from athena /from athena_client.generated.athena /' "$OUT_DIR/athena/athena_pb2_grpc.py"
24+
sed -i -e 's/^from athena /from athena_client.generated.athena /' "$OUT_DIR/athena/athena_pb2.py"
25+
fi
2126

2227
echo "Compilation complete. Files generated in $OUT_DIR"

0 commit comments

Comments
 (0)