This commit is contained in:
Nat Noordanus
2020-05-23 23:37:22 +02:00
parent f6af077ffe
commit 5e2d9febea
8 changed files with 100 additions and 51 deletions

View File

@@ -5,14 +5,14 @@ from typing import Generator
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
root_path = os.path.dirname(os.path.realpath(__file__))
inputs_path = os.path.join(root_path, 'inputs')
output_path_reference = os.path.join(root_path, 'output_reference')
output_path_betterproto = os.path.join(root_path, 'output_betterproto')
inputs_path = os.path.join(root_path, "inputs")
output_path_reference = os.path.join(root_path, "output_reference")
output_path_betterproto = os.path.join(root_path, "output_betterproto")
if os.name == 'nt':
plugin_path = os.path.join(root_path, '..', 'plugin.bat')
if os.name == "nt":
plugin_path = os.path.join(root_path, "..", "plugin.bat")
else:
plugin_path = os.path.join(root_path, '..', 'plugin.py')
plugin_path = os.path.join(root_path, "..", "plugin.py")
def get_files(path, end: str) -> Generator[str, None, None]:
@@ -44,5 +44,7 @@ def protoc_plugin(path: str, output_dir: str):
def protoc_reference(path: str, output_dir: str):
subprocess.run(f"protoc --python_out={output_dir} --proto_path={path} {path}/*.proto", shell=True)
subprocess.run(
f"protoc --python_out={output_dir} --proto_path={path} {path}/*.proto",
shell=True,
)