summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox/modules/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-05-02 22:53:52 +0800
committerruki <[email protected]>2018-05-02 11:23:17 +0800
commit0bafe409d0687ebd429037907f15617fe4b42d53 (patch)
tree102b1e177bc7eb2ca3b2471a55f99fdc2bee3dd6 /xmake/core/sandbox/modules/os.lua
parentd1db6a9b8cc657ea5b3fc1cddb52d3b351639680 (diff)
modify os.match
Diffstat (limited to 'xmake/core/sandbox/modules/os.lua')
-rw-r--r--xmake/core/sandbox/modules/os.lua24
1 files changed, 8 insertions, 16 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua
index 77e55450f..b75df1d66 100644
--- a/xmake/core/sandbox/modules/os.lua
+++ b/xmake/core/sandbox/modules/os.lua
@@ -385,31 +385,23 @@ function sandbox_os.execv(program, argv, opt)
end
-- match files or directories
-function sandbox_os.match(pattern, mode, ...)
-
- -- check
- assert(pattern)
-
- -- format it first
- pattern = vformat(pattern, ...)
-
- -- match it
- return os.match(pattern, mode)
+function sandbox_os.match(pattern, mode)
+ return os.match(vformat(pattern), mode)
end
-- match directories
-function sandbox_os.dirs(pattern, ...)
- return sandbox_os.match(pattern, 'd', ...)
+function sandbox_os.dirs(pattern)
+ return sandbox_os.match(pattern, 'd')
end
-- match files
-function sandbox_os.files(pattern, ...)
- return sandbox_os.match(pattern, 'f', ...)
+function sandbox_os.files(pattern)
+ return sandbox_os.match(pattern, 'f')
end
-- match files and directories
-function sandbox_os.filedirs(pattern, ...)
- return sandbox_os.match(pattern, 'a', ...)
+function sandbox_os.filedirs(pattern)
+ return sandbox_os.match(pattern, 'a')
end
-- is directory?