Merge pull request #87 from reduxionist/fix/use-absolute-path-to-config

Fixes error locating config if not run from src dir
This commit is contained in:
Logykk 2021-10-24 17:39:37 +13:00 committed by GitHub
commit 98f20e7e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,8 @@ class ZSpotify:
@classmethod @classmethod
def load_config(cls) -> None: def load_config(cls) -> None:
with open(CONFIG_FILE_PATH, encoding='utf-8') as config_file: app_dir = os.path.dirname(__file__)
with open(os.path.join(app_dir, CONFIG_FILE_PATH), encoding='utf-8') as config_file:
cls.CONFIG = json.load(config_file) cls.CONFIG = json.load(config_file)
@classmethod @classmethod