diff options
| author | ruki <[email protected]> | 2017-04-09 13:24:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-04-09 13:24:22 +0800 |
| commit | 75ce1622c65240df4017b79d123f64cb6ae8d4c8 (patch) | |
| tree | db4f165944e4ef7f345f88321800294d4b082073 | |
| parent | 7abd447e31cba6b72922754a0c83f60dff036b86 (diff) | |
fix print api bug for
| -rw-r--r-- | xmake/core/sandbox/modules/utils.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua index f09f8ccf5..b2d567015 100644 --- a/xmake/core/sandbox/modules/utils.lua +++ b/xmake/core/sandbox/modules/utils.lua @@ -41,6 +41,23 @@ for k, v in pairs(utils) do end end +-- print each arguments +function sandbox_utils._print(...) + + -- format each arguments + local args = {} + for _, arg in ipairs({...}) do + if type(arg) == "string" then + table.insert(args, vformat(arg)) + else + table.insert(args, arg) + end + end + + -- print multi-variables with raw lua action + utils._print(unpack(args)) +end + -- print format string with newline -- print builtin-variables with $(var) -- print multi-variables with raw lua action @@ -61,14 +78,14 @@ function sandbox_utils.print(format, ...) { function () -- print multi-variables with raw lua action - utils._print(format, unpack(args)) + sandbox_utils._print(format, unpack(args)) end } } else -- print multi-variables with raw lua action - utils._print(format, ...) + sandbox_utils._print(format, ...) end end |
