Skip to content

Commit eb6d59f

Browse files
authored
Merge pull request #1456 from Isaac-Flath/watch_export_bugfix
Export on modified only bug fix
2 parents acbe05c + d5e7e83 commit eb6d59f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nbdev/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def watch_export(nbs:str=None, # Nb directory to watch for changes
186186
def _export(e,lib=lib):
187187
p = e.src_path
188188
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith('.~')):
189-
run(f'nb_export --lib_path {lib} "{p}"')
189+
if e.event_type == 'modified': run(f'nb_export --lib_path {lib} "{p}"')
190190
with fs_watchdog(_export, nbs):
191191
while True: time.sleep(1)
192192

nbs/api/13_cli.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
" def _export(e,lib=lib):\n",
329329
" p = e.src_path\n",
330330
" if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith('.~')):\n",
331-
" run(f'nb_export --lib_path {lib} \"{p}\"')\n",
331+
" if e.event_type == 'modified': run(f'nb_export --lib_path {lib} \"{p}\"')\n",
332332
" with fs_watchdog(_export, nbs):\n",
333333
" while True: time.sleep(1)"
334334
]

0 commit comments

Comments
 (0)