diff options
| author | ruki <[email protected]> | 2024-09-05 17:15:02 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-05 17:15:02 +0800 |
| commit | e9df84ad021c7c8ec020384e250ca5b95fe3e700 (patch) | |
| tree | 3986286cf9b04a0340ca413c01ad242214957ea1 /xmake/core/base | |
| parent | a3f50282bfed783a402b7d97485820ca8ceb0691 (diff) | |
| parent | ee4935050a6165e1da500731fb00f3b08265c266 (diff) | |
Merge pull request #5570 from xmake-io/cpfile
Improve to copy file
Diffstat (limited to 'xmake/core/base')
| -rw-r--r-- | xmake/core/base/os.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 2dba50509..6a1151e23 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -70,6 +70,7 @@ function os._cp(src, dst, rootdir, opt) -- is file or link? local symlink = opt.symlink + local writeable = opt.writeable if os.isfile(src) or (symlink and os.islink(src)) then -- the destination is directory? append the filename @@ -85,7 +86,7 @@ function os._cp(src, dst, rootdir, opt) if opt.force and os.isfile(dst) then os.rmfile(dst) end - if not os.cpfile(src, dst, symlink) then + if not os.cpfile(src, dst, symlink, writeable) then local errors = os.strerror() if symlink and os.islink(src) then local reallink = os.readlink(src) |
