summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-04 09:01:53 +0800
committerruki <[email protected]>2015-06-04 09:01:53 +0800
commit282c12b8f7b9b01a85844326c28f6bc3529aa088 (patch)
tree2f7557c695789276022f8f8094ac17f3e90c2357 /xmake/scripts/base/config.lua
parenta73db10e9b42c8b18bf5b95d78855481beb67f20 (diff)
adjust global and config directory
Diffstat (limited to 'xmake/scripts/base/config.lua')
-rw-r--r--xmake/scripts/base/config.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua
index 7b6ef01b9..05edfc555 100644
--- a/xmake/scripts/base/config.lua
+++ b/xmake/scripts/base/config.lua
@@ -177,12 +177,8 @@ end
-- get the configure file
function config._file()
- -- the options
- local options = xmake._OPTIONS
- assert(options and options.project)
-
- -- get the configure file
- return options.project .. "/.xmake.xconf"
+ -- get it
+ return config.directory() .. "/xmake.xconf"
end
-- get the current target scope
@@ -243,6 +239,21 @@ function config.set(name, value)
config._CURRENT[name] = value
end
+-- get the configure directory
+function config.directory()
+
+ -- the directory
+ local dir = xmake._PROJECT_DIR .. "/.xmake"
+
+ -- create it directly first if not exists
+ if not os.isdir(dir) then
+ assert(os.mkdir(dir))
+ end
+
+ -- get it
+ return dir
+end
+
-- save xmake.xconf
function config.savexconf()