From 33ad09c9a126cb83ba45fb6f1f2c2898cfbb2dbb Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 10 Jun 2015 15:13:17 +0800 Subject: save object to configure --- xmake/scripts/base/config.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'xmake/scripts/base/config.lua') diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua index 4badef0b7..2d5bcdc37 100644 --- a/xmake/scripts/base/config.lua +++ b/xmake/scripts/base/config.lua @@ -118,7 +118,7 @@ function config.get(name) -- the value local value = config._CURRENT[name] - if value and value == "auto" then + if type(value) == "string" and value == "auto" then value = nil end @@ -132,11 +132,6 @@ function config.set(name, value) -- check assert(config._CURRENT and name) - -- invalid value - if value and type(value) == "table" then - assert(false) - end - -- get the current target local target = config._target() assert(target) @@ -322,7 +317,7 @@ function config.clearup() local current = config._CURRENT if current then for k, v in pairs(current) do - if v and type(v) and v == "auto" then + if type(v) == "string" and v == "auto" then current[k] = nil end end @@ -332,7 +327,7 @@ function config.clearup() local target = config._target() if target then for k, v in pairs(target) do - if v and type(v) and v == "auto" then + if type(v) == "string" and v == "auto" then target[k] = nil end end -- cgit v1.3.1