Added an option to write directory configs or not.

This commit is contained in:
sarah committed 2026-04-06 01:41:24 +02:00
1 parent 5dbc03ff7f
commit 42adeae8b7
3 files changed
+8 -13

No files matched your search

+5 -4
View File
@@ -194,10 +194,11 @@ def Dir(Path, Output = True, CopyConf = True):
os.makedirs(Path, exist_ok=True)
if (CopyConf):
Clone("DirConfig.toml", Path, f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml")
UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName)
UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config")
NewDirConf = f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml"
if (Conf["WriteDirConf"] == 1 or not os.path.exists(os.path.join(f"{Path}/{NewDirConf}"))):
Clone("DirConfig.toml", Path, NewDirConf)
UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName)
UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config")
if (Output):
ParsedPath = Parse(String = Path)