File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -181,10 +181,7 @@ def nbdev_create_config(
181
181
182
182
# %% ../nbs/api/01_config.ipynb
183
183
def _nbdev_config_file (cfg_name = _nbdev_cfg_name , path = None ):
184
- cfg_path = path = Path .cwd () if path is None else Path (path )
185
- while cfg_path != cfg_path .parent and not (cfg_path / cfg_name ).exists (): cfg_path = cfg_path .parent
186
- if not (cfg_path / cfg_name ).exists (): cfg_path = path
187
- return cfg_path / cfg_name
184
+ return getattr (Config .find (cfg_name ), 'config_file' , Path .cwd ()/ cfg_name )
188
185
189
186
# %% ../nbs/api/01_config.ipynb
190
187
def _xdg_config_paths (cfg_name = _nbdev_cfg_name ):
Original file line number Diff line number Diff line change 402
402
"source" : [
403
403
" #|export\n " ,
404
404
" def _nbdev_config_file(cfg_name=_nbdev_cfg_name, path=None):\n " ,
405
- " cfg_path = path = Path.cwd() if path is None else Path(path)\n " ,
406
- " while cfg_path != cfg_path.parent and not (cfg_path/cfg_name).exists(): cfg_path = cfg_path.parent\n " ,
407
- " if not (cfg_path/cfg_name).exists(): cfg_path = path\n " ,
408
- " return cfg_path/cfg_name"
405
+ " return getattr(Config.find(cfg_name), 'config_file', Path.cwd()/cfg_name)"
409
406
]
410
407
},
411
408
{
You can’t perform that action at this time.
0 commit comments