diff options
| author | ruki <[email protected]> | 2022-08-23 00:59:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-23 00:59:56 +0800 |
| commit | 3e51aca6b415fdec57c23b1ad430e29a7c1864a5 (patch) | |
| tree | 2f504ea2dc26920b65dffd1dea9d6421a01c01d9 | |
| parent | b07314158a840f5a4828f74ff654b3f242d22d9f (diff) | |
fix link
| -rw-r--r-- | xmake/core/base/os.lua | 3 | ||||
| -rw-r--r-- | xmake/rules/xcode/application/build.lua | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 02e3b7838..fdbc3edbf 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -82,9 +82,6 @@ function os._cp(src, dst, rootdir, opt) -- link file if reserve symlink if opt and opt.symlink and os.islink(src) then local reallink = os.readlink(src) - if os.isfile(dst) then - os.rm(dst) - end if not os.link(reallink, dst) then return false, string.format("cannot link %s(%s) to %s, %s", src, reallink, dst, os.strerror()) end diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua index fcc428b91..bb4ca080b 100644 --- a/xmake/rules/xcode/application/build.lua +++ b/xmake/rules/xcode/application/build.lua @@ -35,7 +35,9 @@ function _copy_frameworks(frameworkdir, frameworksdir) if path.filename(filepath) == "Versions" then _copy_frameworks(filepath, path.join(frameworksdir, "Versions")) else - os.cp(filepath, path.join(frameworksdir, path.filename(filepath)), {symlink = true}) + local dstpath = path.join(frameworksdir, path.filename(filepath)) + os.tryrm(dstpath) + os.cp(filepath, dstpath, {symlink = true}) end end end |
