diff options
| -rw-r--r-- | xmake/core/base/os.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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()) |
