2021-08-31 23:30:14 +08:00
|
|
|
import os
|
|
|
|
|
|
|
|
sysPath = os.getcwd()
|
2021-09-18 15:27:45 +08:00
|
|
|
protoPath = f"{sysPath}/protobuf"
|
2021-08-31 23:30:14 +08:00
|
|
|
|
|
|
|
comm = """
|
2021-09-16 20:43:03 +08:00
|
|
|
protoc --proto_path={} --proto_path={} --go_out=plugins=grpc:{} {}
|
2021-08-31 23:30:14 +08:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def out_proto():
|
|
|
|
# 到达 storage
|
|
|
|
for root, dirs, files in os.walk(protoPath):
|
|
|
|
for f in files:
|
2021-09-16 20:43:03 +08:00
|
|
|
commend = comm.format(protoPath, root, sysPath, f).strip()
|
2021-08-31 23:30:14 +08:00
|
|
|
err = os.system(commend)
|
|
|
|
|
|
|
|
if err:
|
|
|
|
print(f, "-> out put err")
|
2021-11-04 19:20:10 +08:00
|
|
|
return os._exit(-1)
|
2021-08-31 23:30:14 +08:00
|
|
|
else:
|
|
|
|
print(f, "-> success")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
out_proto()
|