Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Protocol buffers grpc web编译带有通配符的原型文件_Protocol Buffers_Grpc Web - Fatal编程技术网

Protocol buffers grpc web编译带有通配符的原型文件

Protocol buffers grpc web编译带有通配符的原型文件,protocol-buffers,grpc-web,Protocol Buffers,Grpc Web,我有一个文件夹protobuf,里面有很多.proto文件,我可以用它们来编译 protoc -I=protobuf filename.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:output 这会将grpc_web_pb.js生成到/output文件夹中,但我正在寻找一种方法,不必为每个文件调用protoc,是否有类似于通配符的东西 我试过了 protoc -I=protobuf *.proto --grpc-web

我有一个文件夹
protobuf
,里面有很多.proto文件,我可以用它们来编译

protoc -I=protobuf filename.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:output
这会将
grpc_web_pb.js
生成到
/output
文件夹中,但我正在寻找一种方法,不必为每个文件调用
protoc
,是否有类似于通配符的东西

我试过了

protoc -I=protobuf *.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:output

但这不起作用,在未找到匹配项的情况下失败:*.proto

这对我有效,也许只需将路径添加到您的
。proto
文件:

protoc -I . --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. ./*.proto

支持通配符。我认为您的路径不正确(换句话说,编译器在它正在查找的目录中找不到原型文件)。