Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Commit

Permalink
error fixes: fix save/level path folders
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Nov 4, 2020
1 parent 5ab076b commit c4c8fa9
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import importlib
from threading import Thread

homepath = path.dirname(path.realpath(__file__))

def config_routes(app: web.Application) -> None:
"""Configures all of the routes and handlers."""
Expand Down Expand Up @@ -124,22 +125,17 @@ def welcome_sequence(no_ascii: bool = False):

def pre_run_checks():
"""Runs checks before startup to make sure all runs smoothly."""
if not path.exists(user_config["level_path"]) or not path.exists(
user_config["save_path"]
):
logging.error(lang.error("START_LVLPATH"))
logging.info(
lang.info(
"SET_LVLPATH", user_config["level_path"], user_config["save_path"]
)
)
raise SystemExit
if not path.exists(user_config["level_path"]):
os.mkdir(user_config["level_path"])
if not path.exists(user_config["save_path"]):
os.mkdir(user_config["save_path"])


def start_plugins():
"""Start plugins"""
plugins = []
homepath = path.dirname(path.realpath(__file__))
if not path.exists(homepath + "/plugins/"):
os.mkdir(homepath + "/plugins/")
for plugin in os.listdir(homepath + "/plugins/"):
if (
not path.isdir(homepath + "/plugins/" + plugin)
Expand Down

0 comments on commit c4c8fa9

Please sign in to comment.