aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipm/project/toml_file.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ipm/project/toml_file.py b/src/ipm/project/toml_file.py
index c855408..6d9ed2a 100644
--- a/src/ipm/project/toml_file.py
+++ b/src/ipm/project/toml_file.py
@@ -30,6 +30,7 @@ def init_infini(
author.multiline(True)
project.add("authors", author)
project.add("license", license)
+ project.add("readme", "README.md")
toml_data.add("project", project)
toml_data.add("requirements", tomlkit.table())
toml_data.add("dependencies", tomlkit.table())
@@ -53,7 +54,9 @@ def init_infini(
"# Initialized `events.py` generated by ipm.\n"
"# Regists your text events and regist global variables here.\n"
"# Documents at https://docs.hydroroll.team/ipm\n\n"
- "from infini.register import Register\n\n\n"
+ "from .events import register as events_register\n\n\n"
+ "from .handlers import register as handlers_register\n\n\n"
+ "from .interceptors import register as interceptors_register\n\n\n"
"register = Register()\n"
)
if not events_filepath.exists():
@@ -90,6 +93,10 @@ def init_infini(
"register = Register()\n"
)
+ readme_filepath = target_path.joinpath("README.md")
+ if not readme_filepath.exists():
+ readme_filepath.write_text(f"# {name.upper()} 规则包文档", encoding="utf-8")
+
def add_yggdrasil(toml_path: Path, name: str, index: str):
project = InfiniProject(toml_path.parent)