diff options
| author | ruki <[email protected]> | 2019-10-18 22:33:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-10-18 09:22:31 +0800 |
| commit | 2b075f93f9a3111d3c0439f13f77c079ba8c2ac0 (patch) | |
| tree | c0262cd6c6ae9e6b3cbc2459587ed533590aa440 /xmake/core/base | |
| parent | 7ef0d3eac5452a5c71f0ad9f7010d376c1f70e4c (diff) | |
improve install tips
Diffstat (limited to 'xmake/core/base')
| -rw-r--r-- | xmake/core/base/process.lua | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/xmake/core/base/process.lua b/xmake/core/base/process.lua index 1e4fe5434..35f74dbde 100644 --- a/xmake/core/base/process.lua +++ b/xmake/core/base/process.lua @@ -79,7 +79,7 @@ end -- tostring(subprocess) function _subprocess:__tostring() - return "subprocess: " .. self:name() + return "<subprocess: " .. self:name() .. ">" end -- gc(subprocess) @@ -163,7 +163,7 @@ function process.asyncrun(task, waitchars) -- trace local waitindex = 0 - local waitchars = waitchars or {'\\', '|', '/', '-'} + local waitchars = waitchars or {'\\', '-', '/', '|'} utils.printf(waitchars[waitindex + 1]) io.flush() @@ -242,7 +242,22 @@ function process.runjobs(jobfunc, total, comax, timeout, timer) -- timer is triggered? call timer if timer and os.mclock() - time > timeout then - timer(indices) + local tips = nil + if #procs > 0 then + local names = {} + for _, proc in ipairs(procs) do + table.insert(names, proc:name()) + end + names = table.unique(names) + if #names > 0 then + names = table.concat(names, ",") + if #names > 16 then + names = names:sub(1, 16) .. ".." + end + tips = string.format("(%d/%s)", #procs, names) + end + end + timer(indices, tips) time = os.mclock() end |
