Skip to content

Commit

Permalink
Export on modified only
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-Flath committed Oct 1, 2024
1 parent acbe05c commit d5e7e83
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 d5e7e83

Please sign in to comment.