-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_folder.py
41 lines (36 loc) · 1.12 KB
/
generate_folder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from pathlib import Path
import json
SCRIPT_DIRECTORY = Path("scripts/")
while 1:
name = input(">>> Script Name:\n... ")
created_directory = SCRIPT_DIRECTORY / name.replace(" ", "_")
created_directory.mkdir(parents=True, exist_ok=True)
with open(created_directory / "README.md", "w", encoding="utf8") as file:
file.write(
"\n".join(
[
f"# {name.title()}|...",
"",
"...",
"",
"## Dependencies|前置",
"",
"- None|無",
]
)
)
with open(created_directory / ".kjspkg", "w", encoding="utf8") as file:
json.dump(
{
"author": "EvanHsieh0415",
"description": "...",
"versions": [9, 10],
"modloaders": ["forge"],
"dependencies": ["mod:"],
},
file,
indent=2,
ensure_ascii=False,
)
if input(">>> continue?\n... ").lower() in {"n", "no"}:
break