mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-interface: Add AUR_CONFIG environment variable
Introduce a new environment variable that can be used to specify the path to an aurweb configuration file. If the environment variable is unset, the default search path is used. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
2f5f5583be
commit
ecbf32f0cc
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ def _get_parser():
|
|||
|
||||
if not _parser:
|
||||
_parser = configparser.RawConfigParser()
|
||||
path = os.path.dirname(os.path.realpath(__file__)) + "/../conf/config"
|
||||
if 'AUR_CONFIG' in os.environ:
|
||||
path = os.environ.get('AUR_CONFIG')
|
||||
else:
|
||||
relpath = "/../conf/config"
|
||||
path = os.path.dirname(os.path.realpath(__file__)) + relpath
|
||||
_parser.read(path)
|
||||
|
||||
return _parser
|
||||
|
|
Loading…
Add table
Reference in a new issue