Skip to content

Commit ec641b0

Browse files
committed
improve some symlink checks
1 parent 03039d3 commit ec641b0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/MultiDocumenter.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ function walk_outputs(f, root, docs::Vector{MultiDocRef}, dirs::Vector{String})
7474
p = joinpath(root, ref.path)
7575
for dir in dirs
7676
dirpath = joinpath(p, dir)
77+
# Symlinks do not really work on Windows. There are permissions problems and we can not
78+
# actually traverse them.
79+
if Sys.iswindows() && islink(dirpath)
80+
@warn "[WINDOWS] Symlink encountered at $(dirpath) -- excluding from search index, since symlinks are not properly supported on Windows."
81+
continue
82+
end
7783
isdir(dirpath) || continue
7884
DocumenterTools.walkdocs(dirpath, DocumenterTools.isdochtml) do fileinfo
7985
f(relpath(dirname(fileinfo.fullpath), root), fileinfo.fullpath)

src/documentertools/canonical_urls.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ function update_canonical_links(docs_directory::AbstractString; canonical::Abstr
101101
# We'll skip all files. This includes files such as index.html, which in this
102102
# directory will likely be the redirect. Also, links should be pointing to other
103103
# versions, so we'll skip them too.
104-
if !isdir(path) || islink(path)
104+
# Note: we need to check islink() first, because on windows, calling isdir() on a
105+
# symlink can make it throw a permissions IOError...
106+
if islink(path) || !isdir(path)
105107
continue
106108
end
107109
# Preview directory is should contain other Documenter directories, so we just add

0 commit comments

Comments
 (0)