From c2f463a161a717fb71ee12281e6715dfcff276e2 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 7 Nov 2016 09:15:11 +0800 Subject: avoid to generate unnecessary .xmake directory --- CHANGELOG.md | 2 ++ xmake/actions/clean/main.lua | 5 ----- xmake/actions/config/main.lua | 5 +++++ xmake/core/main.lua | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 758788b06..e95c1ffb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Bugs fixed * [#41](https://github.com/waruqi/xmake/issues/41): Fix checker bug for windows +* [#43](https://github.com/waruqi/xmake/issues/43): Avoid to generate unnecessary .xmake directory * Add c++ stl search directories for android ## v2.0.5 @@ -173,6 +174,7 @@ ### Bugs修复 * [#41](https://github.com/waruqi/xmake/issues/41): 修复在windows下自动检测x64失败问题 +* [#43](https://github.com/waruqi/xmake/issues/43): 避免创建不必要的.xmake工程缓存目录 * 针对android版本添加c++ stl搜索目录,解决编译c++失败问题 ## v2.0.5 diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua index 8acfa6df9..45e473ca5 100755 --- a/xmake/actions/clean/main.lua +++ b/xmake/actions/clean/main.lua @@ -152,11 +152,6 @@ end -- main function main() - -- check xmake.lua - if not os.isfile(project.file()) then - raise("xmake.lua not found!") - end - -- get the target name local targetname = option.get("target") diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 2d3e1701f..d9495318a 100755 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -135,6 +135,11 @@ function main() -- check xmake.lua if not os.isfile(project.file()) then + + -- remove config directory if exists because the current directory is not a project + os.rm(config.directory(), true) + + -- error raise("xmake.lua not found!") end diff --git a/xmake/core/main.lua b/xmake/core/main.lua index ee336b118..ffd2b123e 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -113,14 +113,14 @@ function main.done() return -1 end - -- save command lines to history - history.save("cmdlines", option.cmdline()) - -- run help? if main._help() then return 0 end + -- save command lines to history + history.save("cmdlines", option.cmdline()) + -- run task local ok, errors = task.run(option.taskname() or "build") if not ok then -- cgit v1.3.1