throw error if not config file found
This commit is contained in:
parent
2537fea06c
commit
aa51d5d786
1 changed files with 2 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ def get_tracker(path: str) -> str:
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
else:
|
||||||
|
raise FileNotFoundError(f"No config file found in {path}.")
|
||||||
tracker = config.get('core', 'tracker', fallback='datalad')
|
tracker = config.get('core', 'tracker', fallback='datalad')
|
||||||
return tracker
|
return tracker
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue