From a1fc9f0ad2b41cd2bf8e99b46a43d7901a2fda80 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 13 Jul 2017 15:15:35 +0800 Subject: fix os.cp and os.mv --- xmake/core/base/os.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index acce3d2e9..94c14ebdc 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -51,7 +51,7 @@ function os._cp(src, dst) if os.isfile(src) then -- the destination is directory? append the filename - if os.isdir(dst) then + if os.isdir(dst) or dst:endswith(path.seperator()) then dst = path.join(dst, path.filename(src)) end @@ -63,7 +63,7 @@ function os._cp(src, dst) elseif os.isdir(src) then -- the destination directory exists? append the filename - if os.isdir(dst) then + if os.isdir(dst) or dst:endswith(path.seperator()) then dst = path.join(dst, path.filename(path.translate(src))) end @@ -91,7 +91,7 @@ function os._mv(src, dst) if os.exists(src) then -- the destination directory exists? append the filename - if os.isdir(dst) then + if os.isdir(dst) or dst:endswith(path.seperator()) then dst = path.join(dst, path.filename(path.translate(src))) end -- cgit v1.3.1