Skip to content

Commit

Permalink
Merge pull request #1456 from Isaac-Flath/watch_export_bugfix
Browse files Browse the repository at this point in the history
Export on modified only bug fix
  • Loading branch information
jph00 authored Oct 2, 2024
2 parents acbe05c + d5e7e83 commit eb6d59f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nbdev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def watch_export(nbs:str=None, # Nb directory to watch for changes
def _export(e,lib=lib):
p = e.src_path
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith('.~')):
run(f'nb_export --lib_path {lib} "{p}"')
if e.event_type == 'modified': run(f'nb_export --lib_path {lib} "{p}"')
with fs_watchdog(_export, nbs):
while True: time.sleep(1)

Expand Down
2 changes: 1 addition & 1 deletion nbs/api/13_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
" def _export(e,lib=lib):\n",
" p = e.src_path\n",
" if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith('.~')):\n",
" run(f'nb_export --lib_path {lib} \"{p}\"')\n",
" if e.event_type == 'modified': run(f'nb_export --lib_path {lib} \"{p}\"')\n",
" with fs_watchdog(_export, nbs):\n",
" while True: time.sleep(1)"
]
Expand Down

0 comments on commit eb6d59f

Please sign in to comment.