support XDG_CONFIG_HOME (closes #1545)
This will only load either
${XDG_CONFIG_HOME}/gallery-dl/config.json or
${HOME}/.config/gallery-dl/config.json
if XDG_CONFIG_HOME is empty, never both.
This commit is contained in:
@@ -179,6 +179,7 @@ Windows:
|
|||||||
|
|
||||||
Linux, macOS, etc.:
|
Linux, macOS, etc.:
|
||||||
* ``/etc/gallery-dl.conf``
|
* ``/etc/gallery-dl.conf``
|
||||||
|
* ``${XDG_CONFIG_HOME}/gallery-dl/config.json``
|
||||||
* ``${HOME}/.config/gallery-dl/config.json``
|
* ``${HOME}/.config/gallery-dl/config.json``
|
||||||
* ``${HOME}/.gallery-dl.conf``
|
* ``${HOME}/.gallery-dl.conf``
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2015-2020 Mike Fährmann
|
# Copyright 2015-2021 Mike Fährmann
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -31,6 +31,8 @@ if util.WINDOWS:
|
|||||||
else:
|
else:
|
||||||
_default_configs = [
|
_default_configs = [
|
||||||
"/etc/gallery-dl.conf",
|
"/etc/gallery-dl.conf",
|
||||||
|
"${XDG_CONFIG_HOME}/gallery-dl/config.json"
|
||||||
|
if os.environ.get("XDG_CONFIG_HOME") else
|
||||||
"${HOME}/.config/gallery-dl/config.json",
|
"${HOME}/.config/gallery-dl/config.json",
|
||||||
"${HOME}/.gallery-dl.conf",
|
"${HOME}/.gallery-dl.conf",
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user