diff options
| author | ruki <[email protected]> | 2015-06-04 09:01:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-04 09:01:53 +0800 |
| commit | 282c12b8f7b9b01a85844326c28f6bc3529aa088 (patch) | |
| tree | 2f7557c695789276022f8f8094ac17f3e90c2357 /xmake/scripts/base/config.lua | |
| parent | a73db10e9b42c8b18bf5b95d78855481beb67f20 (diff) | |
adjust global and config directory
Diffstat (limited to 'xmake/scripts/base/config.lua')
| -rw-r--r-- | xmake/scripts/base/config.lua | 23 |
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() |
