diff options
| author | ruki <[email protected]> | 2017-07-13 15:15:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-13 15:15:35 +0800 |
| commit | a1fc9f0ad2b41cd2bf8e99b46a43d7901a2fda80 (patch) | |
| tree | a7b12a04015033a2af4c13627224616968f6da99 | |
| parent | 73ed3035706e0e7e4891bcee9e351cc3c819b34a (diff) | |
fix os.cp and os.mv
| -rw-r--r-- | xmake/core/base/os.lua | 6 |
1 files 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 |
