diff options
| author | ruki <[email protected]> | 2016-05-19 15:47:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-05-19 15:47:46 +0800 |
| commit | f3ab20418a0b06f84c6afa22ecfebf7965fd646b (patch) | |
| tree | 91f7d98b3c4a5631897af10eda485f58a430724f /xmake/core/sandbox/modules/os.lua | |
| parent | 3f36fc0bee466691f3d0400ae7b4d8259870a15a (diff) | |
impl multi-jobs for builder
Diffstat (limited to 'xmake/core/sandbox/modules/os.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index 030e0c851..1ace961b2 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -186,6 +186,19 @@ function sandbox_os.run(cmd, ...) end end +-- run shell with coroutine +function sandbox_os.corun(cmd, ...) + + -- make command + cmd = vformat(cmd, ...) + + -- run it + local ok, errors = os.corun(cmd) + if not ok then + os.raise(errors) + end +end + -- execute shell function sandbox_os.execute(cmd, ...) |
