summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index dcd5ab5d1..a752b7a42 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -46,6 +46,7 @@ os._getenvs = os._getenvs or os.getenvs
os._cpuinfo = os._cpuinfo or os.cpuinfo
os._meminfo = os._meminfo or os.meminfo
os._readlink = os._readlink or os.readlink
+os._access = os._access or os.access
-- syserror code
os.SYSERR_UNKNOWN = -1
@@ -1155,15 +1156,9 @@ function os.isexec(filepath)
-- check executable program exist
if os.isfile(filepath) then
- return true
- end
- if os.host() == "windows" then
- for _, suffix in ipairs({".exe", ".cmd", ".bat"}) do
- if os.isfile(filepath .. suffix) then
- return true
- end
- end
+ return os._access(filepath, "x")
end
+ return false
end
-- get system host