Skip to content

Commit

Permalink
Merge pull request #5 from PumasAI/mh/relpath-fix
Browse files Browse the repository at this point in the history
Relative path fix
  • Loading branch information
MichaelHatherly authored Jan 11, 2024
2 parents 283e150 + 713c5d6 commit e9a6709
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function evaluate!(
end

function _check_output_dst(s::AbstractString)
s = abspath(s)
dir = dirname(s)
isdir(dir) || throw(ArgumentError("directory does not exist: $(dir)"))
return nothing
Expand Down
20 changes: 20 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -811,4 +811,24 @@ end
)
end
end

@testset "relative paths in `output`" begin
content = read(joinpath(@__DIR__, "examples/stdout.qmd"), String)
mktempdir() do dir
cd(dir) do
server = QuartoNotebookRunner.Server()
write("notebook.qmd", content)
ipynb = "notebook.ipynb"
QuartoNotebookRunner.run!(server, "notebook.qmd"; output = ipynb)

json = JSON3.read(ipynb)

cells = json.cells
cell = cells[8]
@test contains(cell.outputs[1].text, "info text")

close!(server)
end
end
end
end

0 comments on commit e9a6709

Please sign in to comment.