Skip to content

Commit

Permalink
missing mod_list file no longer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EphDoering committed Aug 13, 2024
1 parent 9a5c675 commit cbc3681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
7 changes: 5 additions & 2 deletions mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,11 @@ def __init__(self) -> None:

def __enter__(self) -> None:
assert self.dict == None, "Already in a with statement"
with open(self.MOD_LIST_FILE, "r", encoding="utf8") as fp:
data = json.load(fp)
try:
with open(self.MOD_LIST_FILE, "r", encoding="utf8") as fp:
data = json.load(fp)
except FileNotFoundError:
data = {"mods": []}
self.dict = {m["name"]: m for m in data["mods"]}

self.modified = False
Expand Down
31 changes: 0 additions & 31 deletions mods/mod-list.json

This file was deleted.

0 comments on commit cbc3681

Please # to comment.