summaryrefslogtreecommitdiff
path: root/xmake/core/base/global.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-19 08:39:04 +0800
committerruki <[email protected]>2017-07-19 08:39:04 +0800
commitbfe4432515a8816edc1d32ccfe646096b3ff9c95 (patch)
tree9dd3a14003bb8aed40fd392e6bffbe10e2e8145a /xmake/core/base/global.lua
parent7910713ed804fb60fa8f13b0a4ce915347fc879a (diff)
improve global action
Diffstat (limited to 'xmake/core/base/global.lua')
-rw-r--r--xmake/core/base/global.lua16
1 files changed, 5 insertions, 11 deletions
diff --git a/xmake/core/base/global.lua b/xmake/core/base/global.lua
index daa6a6e54..3bf93bde7 100644
--- a/xmake/core/base/global.lua
+++ b/xmake/core/base/global.lua
@@ -88,6 +88,7 @@ end
function global.load()
-- load configure from the file first
+ local ok = false
local filepath = global._file()
if os.isfile(filepath) then
@@ -97,19 +98,20 @@ function global.load()
-- error?
if not results then
utils.error(errors)
- return true
+ return false
end
-- merge the configure
for name, value in pairs(results) do
if global.get(name) == nil then
global.set(name, value)
+ ok = true
end
end
end
- -- ok
- return true
+ -- ok?
+ return ok
end
-- save the global configure
@@ -126,14 +128,6 @@ function global.save()
return io.save(global._file(), options)
end
--- init the config
-function global.init()
-
- -- clear it
- global._CONFIGS = {}
-
-end
-
-- dump the configure
function global.dump()