JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
823 stars 94 forks source link

[BUG] mkdir error when a directory with a sub-directory is specified for fig_path #398

Closed shg closed 3 years ago

shg commented 3 years ago

description

My memory might be wrong but I think I could use a path with a sub-directory (like "pdf/subdir/") for fig_path in the past version of Weave.jl. Now I get an error when the first level directory ("pdf") does not exist.

ERROR: IOError: mkdir: no such file or directory (ENOENT)

I don't see any reason to intentionally prevent subdir here. Using mkpath instead should fix this.

versions

using InteractiveUtils; versioninfo():

Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

using Pkg; Pkg.status():

Status `~/.julia/environments/v1.5/Project.toml`
[91a5bcdd] Plots v1.6.7
[44d3d7a6] Weave v0.10.4

minimum reproducible steps

test.jmd

# mkdir error test

```julia
using Plots
plot()
```
using Weave
weave("test.jmd", doctype="multimarkdown", fig_path="figures/test.jmd/")
aviatesk commented 3 years ago

thanks for the report, will be fixed by #399