summaryrefslogtreecommitdiff
path: root/xmake/scripts/tools/rm.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/tools/rm.lua')
-rw-r--r--xmake/scripts/tools/rm.lua27
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