Skip to content

Commit

Permalink
Use read + write instead of copying in order to fix
Browse files Browse the repository at this point in the history
file permission error when Documenter is Pkg.added.

(cherry picked from commit 8071a24, PR #1115)
  • Loading branch information
fredrikekre committed Aug 28, 2019
1 parent 61a2627 commit 7700dc3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/doctests/fix/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ function test_doctest_fix(dir)
srcdir = mktempdir(dir)
builddir = mktempdir(dir)
@debug "Testing doctest = :fix" srcdir builddir
cp(joinpath(@__DIR__, "broken.md"), joinpath(srcdir, "index.md"))
cp(joinpath(@__DIR__, "broken.jl"), joinpath(srcdir, "src.jl"))

# Pkg.add changes permission of files to read-only,
# so instead of copying them we read + write.
write(joinpath(srcdir, "index.md"), read(joinpath(@__DIR__, "broken.md")))
write(joinpath(srcdir, "src.jl"), read(joinpath(@__DIR__, "broken.jl")))

# fix up
include(joinpath(srcdir, "src.jl")); @eval import .Foo
Expand Down

0 comments on commit 7700dc3

Please sign in to comment.