#504 determine whether symlinked directories are empty when building (#1089)

This commit is contained in:
Alexander Courtis
2022-03-19 22:49:32 +11:00
committed by GitHub
parent 3cf67c5849
commit 9eea0ca51d

View File

@@ -62,8 +62,10 @@ end
function M.link(absolute_path, name, status, parent_ignored)
--- I dont know if this is needed, because in my understanding, there isnt hard links in windows, but just to be sure i changed it.
local link_to = uv.fs_realpath(absolute_path)
local open, nodes
local open, nodes, has_children
if (link_to ~= nil) and uv.fs_stat(link_to).type == "directory" then
local handle = uv.fs_scandir(link_to)
has_children = handle and uv.fs_scandir_next(handle) ~= nil
open = false
nodes = {}
end
@@ -77,6 +79,7 @@ function M.link(absolute_path, name, status, parent_ignored)
nodes = nodes,
open = open,
fs_stat = uv.fs_stat(absolute_path),
has_children = has_children,
}
end