diff options
| author | ruki <[email protected]> | 2017-02-08 20:40:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-08 20:40:34 +0800 |
| commit | f717d2da6d60566cfe84737950b311b4d7af9275 (patch) | |
| tree | e2250e917c8e8064a84da8bd5d491c375fd3fc50 /xmake/core/sandbox/modules/os.lua | |
| parent | f32315b12be847b6231b025388d72c6b529313c4 (diff) | |
improve os.cp
Diffstat (limited to 'xmake/core/sandbox/modules/os.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index 26c6b40bd..f45e68d83 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -39,21 +39,19 @@ sandbox_os.mtime = os.mtime sandbox_os.mclock = os.mclock -- copy file or directory -function sandbox_os.cp(src, dst) +function sandbox_os.cp(...) - -- check - assert(src and dst) - - -- format it first - src = vformat(src) - dst = vformat(dst) + -- format arguments + local args = {} + for _, arg in ipairs({...}) do + table.insert(args, vformat(arg)) + end -- done - local ok, errors = os.cp(src, dst) + local ok, errors = os.cp(unpack(args)) if not ok then os.raise(errors) end - end -- move file or directory |
