2022-01-17 17:51:18 +08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
path = os.path.abspath(os.path.join(os.getcwd(), '..', 'hbb', 'libs', 'hbb_common', 'protos'))
|
|
|
|
|
|
|
|
if os.name == 'nt':
|
2022-01-20 21:58:28 +08:00
|
|
|
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
2022-01-17 17:51:18 +08:00
|
|
|
print(cmd)
|
|
|
|
os.system(cmd)
|
2022-01-20 21:58:28 +08:00
|
|
|
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ message.proto'%path
|
2022-01-17 17:51:18 +08:00
|
|
|
print(cmd)
|
|
|
|
os.system(cmd)
|
|
|
|
else:
|
2022-01-20 21:58:28 +08:00
|
|
|
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
2022-01-17 17:51:18 +08:00
|
|
|
print(cmd)
|
|
|
|
os.system(cmd)
|
2022-01-20 21:58:28 +08:00
|
|
|
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ message.proto'%path
|
2022-01-17 17:51:18 +08:00
|
|
|
print(cmd)
|
2022-01-20 21:58:28 +08:00
|
|
|
os.system(cmd)
|