diff options
| author | ruki <[email protected]> | 2015-06-03 11:14:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-03 11:14:42 +0800 |
| commit | 648d0f6875478a5184668996f3948a0e61e862a0 (patch) | |
| tree | 1609c20c7e40bd60007f54e0943209c135b4f3d7 /xmake/scripts/base/config.lua | |
| parent | 08bba742c061c93f28c14499fa17af2f1edc2df8 (diff) | |
probe the windows envirnoment
Diffstat (limited to 'xmake/scripts/base/config.lua')
| -rw-r--r-- | xmake/scripts/base/config.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua index f53338a05..92721fa70 100644 --- a/xmake/scripts/base/config.lua +++ b/xmake/scripts/base/config.lua @@ -38,7 +38,7 @@ function config._save_with_level(file, object, level) -- save string if type(object) == "string" then - file:write(object) + file:write(string.format("%q", object)) -- save boolean elseif type(object) == "boolean" then file:write(tostring(object)) @@ -153,7 +153,7 @@ function config._make() -- get configs from all targets for k, v in pairs(configs) do - if type(k) == "string" and not k:find("_%u+") then + if type(k) == "string" and not k:find("^_%u+") then current[k] = v end end @@ -217,7 +217,8 @@ end function config.set(name, value) -- check - assert(config._CURRENT and name and value) + assert(config._CURRENT) + assert(name and value and type(value) ~= "table") -- get the current target local target = config._target() |
