diff options
| author | ruki <[email protected]> | 2015-06-04 14:08:40 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-04 14:08:40 +0800 |
| commit | 1481ec887abef9ce33f4cff93f7a0e6ab04b5741 (patch) | |
| tree | 609560fefb90242fb8deabd525201e00cd078b12 /xmake/scripts/tools/rm.lua | |
| parent | 2f468e35a6c681a22308d1c6d1d37764c386c00c (diff) | |
modify some tool interfaces
Diffstat (limited to 'xmake/scripts/tools/rm.lua')
| -rw-r--r-- | xmake/scripts/tools/rm.lua | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/xmake/scripts/tools/rm.lua b/xmake/scripts/tools/rm.lua index 7759be01d..b05289b3b 100644 --- a/xmake/scripts/tools/rm.lua +++ b/xmake/scripts/tools/rm.lua @@ -20,14 +20,27 @@ -- @file rm.lua -- --- rm all -for _, file_or_dir in ipairs(...) do - if os.exists(file_or_dir) then - if not os.rm(file_or_dir) then - return false +-- define module: rm +local rm = rm or {} + +-- load modules +local os = require("base/os") + +-- the main function +function rm.main(...) + + -- rm all + for _, file_or_dir in ipairs(...) do + if os.exists(file_or_dir) then + if not os.rm(file_or_dir) then + return false + end end end + + -- ok + return true end --- ok -return true +-- return module: rm +return rm |
