UNPKG

535 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2set -e
3shopt -s globstar
4
5#
6# Python Import Class With Same Name as Directory
7# https://stackoverflow.com/q/16245106/1123955
8#
9
10# Directory to write generated code to (.js and .d.ts files)
11OUT_DIR="./src/chatie_grpc"
12[ -d ${OUT_DIR} ] || {
13 mkdir -p ${OUT_DIR}
14}
15
16./merge-proto.sh > "$OUT_DIR/chatie-grpc.proto"
17PROTO_DIR="$OUT_DIR"
18
19PROTOC_CMD="python3 -m grpc_tools.protoc --proto_path=${PROTO_DIR} --proto_path=/usr/local/include/ ${PROTO_DIR}/**/*.proto"
20
21$PROTOC_CMD \
22 --python_betterproto_out=${OUT_DIR}