Skip to content

Commit

Permalink
copy mode recursively for copied symlinks on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Dec 4, 2020
1 parent b3164d7 commit 8c42f53
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/extract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,18 @@ function extract_tarball(
src = reduce(joinpath, init=root, split(what, '/'))
dst = reduce(joinpath, init=root, split(path, '/'))
cp(src, dst)

# Our `cp()` doesn't copy ACL properties, so manually set them via `chmod()`
if Sys.iswindows()
chmod(dst, filemode(src))
# our `cp` doesn't copy ACL properties, so manually set them via `chmod`
function copy_mode(src::String, dst::String)
chmod(dst, filemode(src))
isdir(dst) || return
for name in readdir(dst)
sub_src = joinpath(src, name)
sub_dst = joinpath(dst, name)
copy_mode(sub_src, sub_dst)
end
end
copy_mode(src, dst)
end
end
end
Expand Down

0 comments on commit 8c42f53

Please sign in to comment.