fix(shell): update gen proto
This commit is contained in:
parent
9a1f1fe0ee
commit
3c8d4fd89b
|
@ -3,7 +3,7 @@ import os
|
|||
import yaml
|
||||
|
||||
sysPath = os.getcwd()
|
||||
tempPath = f"{sysPath}/pkg/storage/temp"
|
||||
tempPath = f"{sysPath}/storage/temp"
|
||||
structurePath = f"{sysPath}/pkg/structure"
|
||||
protobufPath = f"{sysPath}/protobuf"
|
||||
|
||||
|
@ -30,9 +30,8 @@ def load_conf():
|
|||
|
||||
# 生成对应的数据结构proto文件
|
||||
def mk_structure(cfg_camel):
|
||||
path = "protobuf"
|
||||
for key, value in cfg_camel.items():
|
||||
proto_path = path + '/' + key + '.proto'
|
||||
proto_path = f"{protobufPath}/{key}.proto"
|
||||
if not os.path.exists(proto_path): # 如果这个文件不存在
|
||||
'''生成对应的数据结构proto文件'''
|
||||
file = open(proto_path, 'w')
|
||||
|
@ -80,6 +79,6 @@ def mk_storage(cfg_camel):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
conf, cfg_camel = load_conf()
|
||||
_, cfg_camel = load_conf()
|
||||
mk_structure(cfg_camel) # 生成对应的数据结构proto文件
|
||||
mk_storage(cfg_camel)
|
||||
|
|
Loading…
Reference in New Issue