From f4887b60b0d0303380df5634131b9fed1686eeeb Mon Sep 17 00:00:00 2001 From: "Marten (msc)" Date: Sun, 6 Nov 2022 11:04:40 -0500 Subject: [PATCH] fix missing import: `read_nb`; check output dir --- tools/clean.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/clean.py b/tools/clean.py index 624f0c694..b4e512444 100755 --- a/tools/clean.py +++ b/tools/clean.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import nbformat +from execnb.nbio import read_nb from nbdev.export import * from nbdev.clean import * from fastcore.all import * @@ -29,6 +30,8 @@ def proc_all( path:str='.', # Path for source NBs dest_path:str='clean'): # Path for dest NBs path,dest_path = Path(path),Path(dest_path) + if not dest_path.is_dir(): + dest_path.mkdir() fns = [f for f in path.iterdir() if f.suffix == '.ipynb' and not f.name.startswith('_')] for fn in fns: proc_nb(fn, dest=dest_path)