summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-30 22:44:09 +0800
committerruki <[email protected]>2026-01-30 22:44:09 +0800
commite299709deb2b8b90aaecdaf61584415a951530f5 (patch)
treee4a54cbaa3fe4ded895163eb7bc54e06eb00bad9 /xmake/core/base/os.lua
parentba2d6e53168827d73d0d726ee607cc69ea6e47d4 (diff)
improve os.isexec
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index c3a48b561..24e055eb9 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -1149,14 +1149,12 @@ end
-- is executable program file?
function os.isexec(filepath)
- assert(filepath)
-
if os.host() == "windows" then
local exts = {".exe", ".com", ".cmd", ".bat", ".ps1", ".sh"}
if os.isfile(filepath) then
- local extension = path.extension(filepath):lower()
+ local extension = path.extension(filepath)
if extension and #extension > 0 then
- if table.contains(exts, extension) then
+ if table.contains(exts, extension:lower()) then
return true
end
else