From b07314158a840f5a4828f74ff654b3f242d22d9f Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 23 Aug 2022 00:59:30 +0800 Subject: fix link --- xmake/core/base/os.lua | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.3.1