diff options
| author | ruki <[email protected]> | 2026-01-30 22:44:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-30 22:44:09 +0800 |
| commit | e299709deb2b8b90aaecdaf61584415a951530f5 (patch) | |
| tree | e4a54cbaa3fe4ded895163eb7bc54e06eb00bad9 /xmake/core/base/os.lua | |
| parent | ba2d6e53168827d73d0d726ee607cc69ea6e47d4 (diff) | |
improve os.isexec
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 6 |
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 |
