summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-10 15:13:17 +0800
committerruki <[email protected]>2015-06-10 15:13:17 +0800
commit33ad09c9a126cb83ba45fb6f1f2c2898cfbb2dbb (patch)
treed5d9b3c7c39a10426fa5900f5021fabb9e49dfdd /xmake/scripts/base/config.lua
parent112bd89dfd816cac735e447e41de0ff9c5687390 (diff)
save object to configure
Diffstat (limited to 'xmake/scripts/base/config.lua')
-rw-r--r--xmake/scripts/base/config.lua11
1 files changed, 3 insertions, 8 deletions
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