Fix pyproject.toml not existing error. (#217)
This commit is contained in:
@@ -193,10 +193,12 @@ async def init(ctx: Context, tortoise_orm, location, src_folder):
|
||||
# check that we can find the configuration, if not we can fail before the config file gets created
|
||||
add_src_path(src_folder)
|
||||
get_tortoise_config(ctx, tortoise_orm)
|
||||
|
||||
with open(config_file, "r") as f:
|
||||
content = f.read()
|
||||
doc = tomlkit.parse(content)
|
||||
if Path(config_file).exists():
|
||||
with open(config_file, "r") as f:
|
||||
content = f.read()
|
||||
doc = tomlkit.parse(content)
|
||||
else:
|
||||
doc = tomlkit.parse("[tool.aerich]")
|
||||
table = tomlkit.table()
|
||||
table["tortoise_orm"] = tortoise_orm
|
||||
table["location"] = location
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.6.0"
|
||||
__version__ = "0.6.1"
|
||||
|
||||
Reference in New Issue
Block a user