From c56a81ab6498c3d25b9e0aa1f80144d9d2e3af21 Mon Sep 17 00:00:00 2001 From: Etaash Mathamsetty <45927311+Etaash-mathamsetty@users.noreply.github.com> Date: Sat, 14 Oct 2023 06:51:14 -0400 Subject: [PATCH] [lfs] Allow setting config dir via `LEGENDARY_CONFIG_PATH` env var (#590) --- legendary/lfs/lgndry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 2d5154c..2e9b0bf 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -26,7 +26,9 @@ class LGDLFS: def __init__(self, config_file=None): self.log = logging.getLogger('LGDLFS') - if config_path := os.environ.get('XDG_CONFIG_HOME'): + if config_path := os.environ.get('LEGENDARY_CONFIG_PATH'): + self.path = config_path + elif config_path := os.environ.get('XDG_CONFIG_HOME'): self.path = os.path.join(config_path, 'legendary') else: self.path = os.path.expanduser('~/.config/legendary')