mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Fix overwriting existing init files in code generator (#637)
This commit is contained in:
@@ -175,8 +175,9 @@ class GenService:
|
||||
code_folder.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
init_filepath = code_folder.joinpath('__init__.py')
|
||||
async with aiofiles.open(init_filepath, 'w', encoding='utf-8') as f:
|
||||
await f.write(gen_template.init_content)
|
||||
if not os.path.exists(init_filepath):
|
||||
async with aiofiles.open(init_filepath, 'w', encoding='utf-8') as f:
|
||||
await f.write(gen_template.init_content)
|
||||
|
||||
# api __init__.py
|
||||
if 'api' in str_code_filepath:
|
||||
|
||||
Reference in New Issue
Block a user