diff options
| author | OpportunityLiu <[email protected]> | 2019-06-19 12:16:39 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-19 12:16:39 +0800 |
| commit | 3af56e9fc4ac64992b3733d3bb4d9de25de23231 (patch) | |
| tree | a931bafa5936f2713623ff08ee07790902fff559 | |
| parent | 509475b2b68e420be7f915755806b3ec9bf7282f (diff) | |
move dump to utils
| -rw-r--r-- | xmake/core/base/utils.lua | 6 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/utils.lua | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua index 314dcaca7..d30ecfaa9 100644 --- a/xmake/core/base/utils.lua +++ b/xmake/core/base/utils.lua @@ -25,10 +25,14 @@ local utils = utils or {} local option = require("base/option") local colors = require("base/colors") local string = require("base/string") -local table = require("base/table") local log = require("base/log") local dump = require("base/dump") +function utils.dump(value, indent) + dump(value, indent or "") + io.write("\n") +end + -- print string with newline function utils._print(...) diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua index 84d8bf208..5aac47a3c 100644 --- a/xmake/core/sandbox/modules/utils.lua +++ b/xmake/core/sandbox/modules/utils.lua @@ -28,7 +28,6 @@ local try = require("sandbox/modules/try") local catch = require("sandbox/modules/catch") local vformat = require("sandbox/modules/vformat") local raise = require("sandbox/modules/raise") -local dump = require("base/dump") -- define module local sandbox_utils = sandbox_utils or {} @@ -176,7 +175,7 @@ function sandbox_utils.assert(value, format, ...) if format ~= nil then raise(format, ...) else - raise("assertion failed!") + raise("assertion failed!") end end @@ -192,8 +191,7 @@ end -- dump value function sandbox_utils.dump(value, indent) if not option.get("quiet") then - dump(value, indent or "") - io.write("\n") + return utils.dump(value, indent) end end |
