diff options
| author | ruki <[email protected]> | 2022-08-23 00:59:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-23 00:59:30 +0800 |
| commit | b07314158a840f5a4828f74ff654b3f242d22d9f (patch) | |
| tree | 32acc0dbf8a6ca463215f8730d0c4d98ca63fdff | |
| parent | 910b11a87f0e6a3719609d8be0f77b6e8bd7e06b (diff) | |
fix link
| -rw-r--r-- | xmake/core/base/os.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index fdbc3edbf..02e3b7838 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -82,6 +82,9 @@ 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 |
