We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d43d5af commit eff9021Copy full SHA for eff9021
betterproto/plugin.py
@@ -363,10 +363,20 @@ def generate_code(request, response):
363
inits.add(base)
364
365
for base in inits:
366
+ name = os.path.join(base, "__init__.py")
367
+
368
+ if os.path.exists(name):
369
+ # Never overwrite inits as they may have custom stuff in them.
370
+ continue
371
372
init = response.file.add()
- init.name = os.path.join(base, "__init__.py")
373
+ init.name = name
374
init.content = b""
375
376
+ filenames = sorted([f.name for f in response.file])
377
+ for fname in filenames:
378
+ print(f"Writing {fname}", file=sys.stderr)
379
380
381
def main():
382
"""The plugin's main entry point."""
0 commit comments