I have the following .sh
file that I run to build my protos.
mkdir -p ./src/gen
protoc -I=../protos/ \
../protos/common/*.proto \
../protos/service/protos/*.proto \
../protos/ui/*.proto \
../protos/*.proto \
--js_out=import_style=commonjs,binary:./src/gen \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./src/gen
It works great, however, my team might add other directories to the protos
directory that this file doesn't see.
Is there a way for me to update this script to get all .proto
files in the protos
directory?
I've tried the following but it didn't work:
mkdir -p ./src/gen
protoc -I=../protos/**/*.proto \
--js_out=import_style=commonjs,binary:./src/gen \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./src/gen
I'm sure it's just some syntax issue, but I'm not sure how to do it.
EDIT:
I've implemented something to make my generators more flexible, but it's still messy:
mkdir -p ./src/gen
protoc -I=../protos/ \
../protos/*.proto \
../protos/**/*.proto \
../protos/**/**/*.proto \
../protos/**/**/**/*.proto \
../protos/**/**/**/**/*.proto \
--js_out=import_style=commonjs,binary:./src/gen \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./src/gen