diff options
| author | Saikari <[email protected]> | 2026-01-29 07:53:57 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-29 07:53:57 +0300 |
| commit | 435178d4a85f8852999a1f8793c506af436ebe84 (patch) | |
| tree | e0989683b2cff47987b87b18e5d4bc1ee63975bc | |
| parent | c5d5e3b16f720b0d0945af0237d0bc1fd6b3f82d (diff) | |
Refactor os.isexec function to simplify Windows executable checks by removing redundant extension checks
| -rw-r--r-- | xmake/core/base/os.lua | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 3efff97fe..726d64d39 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -1157,21 +1157,11 @@ function os.isexec(filepath) -- check executable program exist if os.isfile(filepath) then if os.host() == "windows" then - local ext = path.extension(filepath):lower() - if ext == ".exe" or ext == ".cmd" or ext == ".bat" or ext == ".ps1" or ext == ".sh" then - return true - end + return true else return os._access(filepath, "x") end end - if os.host() == "windows" then - for _, suffix in ipairs({".exe", ".cmd", ".bat", ".ps1", ".sh"}) do - if os.isfile(filepath .. suffix) then - return true - end - end - end return false end |
