diff options
| author | Saikari <[email protected]> | 2026-01-28 17:52:49 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-28 17:52:49 +0300 |
| commit | 9c86aa7667c81d4e492d7418702ae50befdbd38b (patch) | |
| tree | 0b0480f7dfb0b3cecd96751771a8a215b33cddf5 | |
| parent | 3770cbb70e047eb40c94960480857507e8624fe9 (diff) | |
Enhance os.isexec function to correctly identify Windows executable files
| -rw-r--r-- | xmake/core/base/os.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 8a9cde4cd..963a015c1 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -1157,7 +1157,10 @@ function os.isexec(filepath) -- check executable program exist if os.isfile(filepath) then if os.host() == "windows" then - return true + local ext = path.extension(filepath):lower() + if ext == ".exe" or ext == ".cmd" or ext == ".bat" then + return true + end else return os._access(filepath, "x") end |
