From 8c42f53964f78c8ec7ac7c59e161de0a99d264ab Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Fri, 4 Dec 2020 06:48:46 -0800 Subject: [PATCH] copy mode recursively for copied symlinks on Windows --- src/extract.jl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/extract.jl b/src/extract.jl index 82971b8..6da350e 100644 --- a/src/extract.jl +++ b/src/extract.jl @@ -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