diff options
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 702d97c82..b668647e2 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -360,6 +360,23 @@ function os.raise(msg, ...) end end +-- is executable program? +function os.isexec(filepath) + + -- check + assert(filepath) + + -- TODO + -- check permission + + -- is *.exe for windows? + if xmake._HOST == "windows" and not filepath:find("%.exe") then + filepath = filepath .. ".exe" + end + + -- file exists? + return os.isfile(filepath) +end -- return module return os |
