mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-04-19 05:27:34 -05:00
Add auto removal/creation for SSE file
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
parent
d983fab920
commit
3eb796cbff
|
|
@ -556,6 +556,11 @@ def delete_old_files() -> None:
|
|||
if OUTPUT_TMP_DIR.is_dir():
|
||||
shutil.rmtree(OUTPUT_TMP_DIR)
|
||||
|
||||
if not SPOILER_SETS.get():
|
||||
OUTPUT_DIR.joinpath("SpoilerSeasonEnabled").unlink()
|
||||
else:
|
||||
OUTPUT_DIR.joinpath("SpoilerSeasonEnabled").open("w").write(" ")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""
|
||||
|
|
@ -579,9 +584,10 @@ def main() -> None:
|
|||
# Save for spoiler.xml
|
||||
spoiler_xml[set_info["code"]] = trice_dict
|
||||
|
||||
# Write out the spoiler.xml file
|
||||
write_spoilers_xml(spoiler_xml)
|
||||
write_spoilers_json(spoiler_xml)
|
||||
if spoiler_xml:
|
||||
# Write out the spoiler.xml file
|
||||
write_spoilers_xml(spoiler_xml)
|
||||
write_spoilers_json(spoiler_xml)
|
||||
|
||||
# Cleanup outdated stuff that's not necessary
|
||||
delete_old_files()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user