[BUG] An out_path
arg with a "." in last segment results in incorrect save path
#449
Labels
out_path
arg with a "." in last segment results in incorrect save path
#449
description
If the
out_path
argument toweave
contains a"."
character in the last segment, e.g."/path/1.2"
then the file ends up being saved to e.g."/path/1.html"
.I don't think this is the case with an ending slash e.g.
"/path/1.2/"
.One reason to have a
"."
character like this is using a timestamp as a folder for an experiment, e.g.Dates.now() == 2022-02-21T16:22:11.715
.I think the reason is here:
Weave.jl/src/run.jl
Lines 117 to 130 in 381de22
It calls
splitext
before checking whether a folder or file was passed.Perhaps it could instead condition on
isdir
and then if notisdir
, callsplitext
to get the file extension.versions
(private packages omitted)
minimum reproducible steps
Should be reproduced by calling something like
weave("/path/to/script.jl"; doctype="md2html", out_path="/some/other/path/1.2")
and observing where the HTML file is saved.The text was updated successfully, but these errors were encountered: