Skip to content

Commit f1dbe50

Browse files
authored
Don't scaffold an empty package when nbdev-export exports nothing
1 parent 8fd0862 commit f1dbe50

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

nbdev/doclinks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ def nbdev_export(
154154
procs = [import_obj(p) for p in procs] if procs else None
155155
files = nbglob(path=path, as_path=True, **kwargs).sorted('name')
156156
for f in files: nb_export(f, procs=procs)
157-
add_init(cfg.lib_path)
158-
update_llms_txt()
159-
_build_modidx()
157+
if cfg.lib_path.exists():
158+
add_init(cfg.lib_path)
159+
update_llms_txt()
160+
_build_modidx()
160161

161162
# %% ../nbs/api/05_doclinks.ipynb #3134c22b
162163
typs = 'module','class','method','function'

nbs/api/05_doclinks.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,10 @@
379379
" procs = [import_obj(p) for p in procs] if procs else None\n",
380380
" files = nbglob(path=path, as_path=True, **kwargs).sorted('name')\n",
381381
" for f in files: nb_export(f, procs=procs)\n",
382-
" add_init(cfg.lib_path)\n",
383-
" update_llms_txt()\n",
384-
" _build_modidx()"
382+
" if cfg.lib_path.exists():\n",
383+
" add_init(cfg.lib_path)\n",
384+
" update_llms_txt()\n",
385+
" _build_modidx()"
385386
]
386387
},
387388
{

0 commit comments

Comments
 (0)