summaryrefslogtreecommitdiff
path: root/xmake/core/base/global.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-17 23:27:42 +0800
committerruki <[email protected]>2018-09-17 14:46:14 +0800
commitb39865ce22ec806099bd022f47fcb90a4ac42034 (patch)
treeb8f87745eff3541b5691941dc69d03b9060a4971 /xmake/core/base/global.lua
parenteceee6a9d0f2f76e1b8cae374dbfbc1bacbc7389 (diff)
add env to modify tmpdir and globaldir
Diffstat (limited to 'xmake/core/base/global.lua')
-rw-r--r--xmake/core/base/global.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/base/global.lua b/xmake/core/base/global.lua
index f041c759d..9f8f5c08d 100644
--- a/xmake/core/base/global.lua
+++ b/xmake/core/base/global.lua
@@ -103,7 +103,10 @@ end
-- get the global configure directory
function global.directory()
- return path.translate("~/.xmake")
+ if global._ROOTDIR == nil then
+ global._ROOTDIR = os.getenv("XMAKE_GLOBALDIR") or path.translate("~/.xmake")
+ end
+ return global._ROOTDIR
end
-- load the global configure