diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2015-09-18 20:06:15 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2015-09-20 23:57:45 (GMT) |
commit | a4d62eb91b4045849031a379d7399a89df9fb853 (patch) | |
tree | f45f9b1fc3dae7fb02074e857ca6ae7f5ab11e8d /tools | |
parent | a65e97c541d9fd6a881771b89fa7190bdfc49650 (diff) | |
download | mxe-a4d62eb91b4045849031a379d7399a89df9fb853.zip mxe-a4d62eb91b4045849031a379d7399a89df9fb853.tar.gz mxe-a4d62eb91b4045849031a379d7399a89df9fb853.tar.bz2 |
build-pkg: add function testCommand
This function runs a command and return whether it
finished successfully.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build-pkg.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index 44a58ba..fdfa577 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -135,6 +135,15 @@ local function shell(cmd) return text end +local function testCommand(cmd) + if _VERSION == 'Lua 5.1' then + return os.execute(cmd) == 0 + else + -- Lua >= 5.2 + return os.execute(cmd) + end +end + local function fileExists(name) local f = io.open(name, "r") if f ~= nil then |