From e56f3df1cc28e5012ac640da884f9ddb501b169a Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Thu, 25 Apr 2024 01:25:01 -0400 Subject: [PATCH] Fix use of relative paths so that the macOS .app works --- NUSD-Py.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/NUSD-Py.py b/NUSD-Py.py index 22b490a..282b1a2 100644 --- a/NUSD-Py.py +++ b/NUSD-Py.py @@ -333,9 +333,13 @@ if __name__ == "__main__": database_file = open(os.path.join(os.path.dirname(__file__), "data/wii-database.json")) wii_database = json.load(database_file) - out_folder = pathlib.Path("titles") - if not out_folder.is_dir(): - out_folder.mkdir() + try: + # noinspection PyUnresolvedReferences + out_folder = os.path.join(__compiled__.containing_dir, "titles") + except NameError: + out_folder = os.path.join(os.path.dirname(sys.argv[0]), "titles") + if not os.path.isdir(out_folder): + os.mkdir(out_folder) window = MainWindow() window.setWindowTitle("NUSD-Py")