wheat-cache/shell/proto.py

27 lines
602 B
Python
Raw Normal View History

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