From 0313783aee60940bf6b38e71dda3310d4d5e967c Mon Sep 17 00:00:00 2001 From: "Velimir (monty) Vesselinov" Date: Sun, 28 Jul 2024 22:06:45 -0600 Subject: [PATCH] nb_clean fix --- src/MadsNotebooks.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/MadsNotebooks.jl b/src/MadsNotebooks.jl index daccba8f..0f45155d 100644 --- a/src/MadsNotebooks.jl +++ b/src/MadsNotebooks.jl @@ -74,8 +74,11 @@ function notebook_export(rootname::AbstractString; notebook_directory=joinpath(M @info("Processing $(f) in directory $(d) ...") c = pwd() cd(d) - Mads.runcmd("python3 ~/system/notebook-clean.py $(r).ipynb"; quiet=false, pipe=false) - Mads.runcmd("rm -fR $(r)_files") + nb_clean = joinpath(ENV["HOMEPATH"], "system", "notebook-clean.py") + if isfile(nb_clean) + Mads.runcmd("python3 $(nb_clean) $(r).ipynb"; quiet=false, pipe=false) + Mads.runcmd("rm -fR $(r)_files") + end Mads.runcmd("python3 -m nbconvert --to script $(r).ipynb") @info("Julia script file created: $(r).jl") Mads.runcmd("python3 -m nbconvert --to html $(r).ipynb")