summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-02 22:01:17 +0800
committerruki <[email protected]>2016-07-02 22:01:17 +0800
commit383c46c282fe0fcd82e2bc8a2d227cd0528af262 (patch)
tree40b8247e9542856b1e1187ef9066796f0ce70d7d /xmake/core/base/os.lua
parentaf3465afb3f509904099170b986f46937784b3e5 (diff)
fix check bug for android on windows
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 702d97c82..b668647e2 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -360,6 +360,23 @@ function os.raise(msg, ...)
end
end
+-- is executable program?
+function os.isexec(filepath)
+
+ -- check
+ assert(filepath)
+
+ -- TODO
+ -- check permission
+
+ -- is *.exe for windows?
+ if xmake._HOST == "windows" and not filepath:find("%.exe") then
+ filepath = filepath .. ".exe"
+ end
+
+ -- file exists?
+ return os.isfile(filepath)
+end
-- return module
return os