diff options
| author | ruki <[email protected]> | 2016-04-13 10:13:37 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-04-13 10:13:37 +0800 |
| commit | 097a0d5eb612d898fb8de01d6db7760aed947b4b (patch) | |
| tree | 9c2ad3ffe67da1663953f9b7097721e96156cb18 /xmake/core/sandbox/modules/os.lua | |
| parent | 833bfb207b3f924eaa81feb496cf74e6223d0041 (diff) | |
throw os.run errors
Diffstat (limited to 'xmake/core/sandbox/modules/os.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index a05e26939..44bef94e1 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -165,17 +165,11 @@ function sandbox_os.run(cmd, ...) -- make command cmd = vformat(cmd, ...) - -- make temporary log file - local log = os.tmpname() - - -- run command - if 0 ~= os.execute(cmd .. string.format(" > %s 2>&1", log)) then - io.cat(log) - os.raise("run: %s failed!", cmd) + -- run it + local ok, errors = os.run(cmd) + if not ok then + os.raise(errors) end - - -- remove the temporary log file - os.rm(log) end -- match files or directories |
