From 23432a2befdc06cb2e48aea344c3ba0941d56490 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 21 May 2017 09:17:02 +0800 Subject: fix os.mv to dir bug --- xmake/core/base/os.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xmake/core/base/os.lua') diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 7827064e3..21bec949c 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -86,6 +86,12 @@ function os._mv(src, dst) -- exists file or directory? if os.exists(src) then + + -- the destination directory exists? append the filename + if os.isdir(dst) then + dst = path.join(dst, path.filename(path.translate(src))) + end + -- move file or directory if not os.rename(src, dst) then return false, string.format("cannot move %s to %s %s", src, dst, os.strerror()) -- cgit v1.3.1