diff options
| author | ruki <[email protected]> | 2020-06-02 22:36:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-02 09:39:41 +0800 |
| commit | 5cdcb3547f4d67b242018d9a5cb4c4a7e8af8609 (patch) | |
| tree | a970842cff38a22d0e4dfb6900ed6f7282c47a6f | |
| parent | c1c4b41dc630828d99bcb996efc7be8d1adca565 (diff) | |
improve configdir
| -rw-r--r-- | xmake/core/project/config.lua | 8 | ||||
| -rw-r--r-- | xmake/plugins/show/info/basic.lua | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua index 49d093663..382ab03e0 100644 --- a/xmake/core/project/config.lua +++ b/xmake/core/project/config.lua @@ -148,7 +148,13 @@ end -- get the configure directory on the current host/arch platform function config.directory() if config._DIRECTORY == nil then - local rootdir = os.getenv("XMAKE_CONFIGDIR") or os.projectdir() + local rootdir = os.getenv("XMAKE_CONFIGDIR") + if not rootdir and os.isdir(path.join(os.workingdir(), ".xmake")) then + rootdir = os.workingdir() + end + if not rootdir then + rootdir = os.projectdir() + end config._DIRECTORY = path.join(rootdir, "." .. xmake._NAME, os.host(), os.arch()) end return config._DIRECTORY diff --git a/xmake/plugins/show/info/basic.lua b/xmake/plugins/show/info/basic.lua index 2ed59fef6..61bd7ef57 100644 --- a/xmake/plugins/show/info/basic.lua +++ b/xmake/plugins/show/info/basic.lua @@ -39,6 +39,7 @@ function main() cprint(" ${color.dump.string}programfile${clear}: %s", xmake.programfile()) cprint(" ${color.dump.string}globaldir${clear}: %s", global.directory()) cprint(" ${color.dump.string}tmpdir${clear}: %s", os.tmpdir()) + cprint(" ${color.dump.string}workingdir${clear}: %s", os.workingdir()) cprint(" ${color.dump.string}packagedir${clear}: %s", package.installdir()) cprint(" ${color.dump.string}packagedir(cache)${clear}: %s", package.cachedir()) print("") |
