mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 17:55:16 +00:00
debug logs on config path
This commit is contained in:
@@ -216,36 +216,45 @@ class Options(AttrMonitor):
|
|||||||
"""get the config path"""
|
"""get the config path"""
|
||||||
# cli provided
|
# cli provided
|
||||||
if self.args['--cfg']:
|
if self.args['--cfg']:
|
||||||
|
self.log.dbg(f'config from --cfg {self.args["--cfg"]}')
|
||||||
return os.path.expanduser(self.args['--cfg'])
|
return os.path.expanduser(self.args['--cfg'])
|
||||||
|
|
||||||
# environment variable provided
|
# environment variable provided
|
||||||
if ENV_CONFIG in os.environ:
|
if ENV_CONFIG in os.environ:
|
||||||
|
self.log.dbg(f'config from env {ENV_CONFIG}')
|
||||||
return os.path.expanduser(os.environ[ENV_CONFIG])
|
return os.path.expanduser(os.environ[ENV_CONFIG])
|
||||||
|
|
||||||
# look in current directory
|
# look in current directory
|
||||||
if os.path.exists(CONFIGFILEYAML):
|
if os.path.exists(CONFIGFILEYAML):
|
||||||
|
self.log.dbg(f'config from yaml in current dir {CONFIGFILEYAML}')
|
||||||
return CONFIGFILEYAML
|
return CONFIGFILEYAML
|
||||||
|
|
||||||
# look in current directory
|
# look in current directory
|
||||||
if os.path.exists(CONFIGFILETOML):
|
if os.path.exists(CONFIGFILETOML):
|
||||||
|
self.log.dbg(f'config from toml in current dir {CONFIGFILETOML}')
|
||||||
return CONFIGFILETOML
|
return CONFIGFILETOML
|
||||||
|
|
||||||
path = self._get_config_from_env(CONFIGFILEYAML)
|
path = self._get_config_from_env(CONFIGFILEYAML)
|
||||||
if path:
|
if path:
|
||||||
|
self.log.dbg(f'config from env with {CONFIGFILEYAML}')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
path = self._get_config_from_env(CONFIGFILETOML)
|
path = self._get_config_from_env(CONFIGFILETOML)
|
||||||
if path:
|
if path:
|
||||||
|
self.log.dbg(f'config from env with {CONFIGFILETOML}')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
path = self._get_config_from_fs(CONFIGFILEYAML)
|
path = self._get_config_from_fs(CONFIGFILEYAML)
|
||||||
if path:
|
if path:
|
||||||
|
self.log.dbg(f'config from fs with {CONFIGFILEYAML}')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
path = self._get_config_from_fs(CONFIGFILETOML)
|
path = self._get_config_from_fs(CONFIGFILETOML)
|
||||||
if path:
|
if path:
|
||||||
|
self.log.dbg(f'config from fs with {CONFIGFILETOML}')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
self.log.dbg('no config file found')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _header(self):
|
def _header(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user