diff options
| author | ruki <[email protected]> | 2016-05-30 09:21:58 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-05-30 09:21:58 +0800 |
| commit | 23acb023758b0b47cb5083d0d800fc48fc96d920 (patch) | |
| tree | ec5af9f5185aafb2dd7f7d6d46494f838a602b75 /xmake/core/base/os.lua | |
| parent | 4b86a4104d8076636ffa9a778b244f698aec5a49 (diff) | |
impl install action
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index bb73b6c43..91dba1524 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -106,7 +106,7 @@ function os.cp(src, dst) -- the destination is directory? append the filename if os.isdir(dst) then - dst = string.format("%s/%s", dst, path.filename(src)) + dst = path.join(dst, path.filename(src)) end -- copy file @@ -115,6 +115,12 @@ function os.cp(src, dst) end -- is directory? elseif os.isdir(src) then + + -- the destination directory exists? append the filename + if os.isdir(dst) then + dst = path.join(dst, path.filename(path.translate(src))) + end + -- copy directory if not os.cpdir(src, dst) then return false, string.format("cannot copy directory %s to %s %s", src, dst, os.strerror()) |
