From b3e5d26680f6c72948b09c8156910ee580b65eb8 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 4 May 2017 15:46:37 +0800 Subject: avoid generate .xmake directory --- CHANGELOG.md | 2 ++ xmake/core/main.lua | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef2e1b42b..2ee820c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * [#73](https://github.com/tboox/xmake/issues/73): Attempt to get executable path as xmake's program directory * Improve the scope of `xmake.lua` in `add_subdirs` and use independent sub-scope to avoid dirty scope * [#78](https://github.com/tboox/xmake/pull/78): Get terminal size in runtime and soft-wrap the help printing +* Avoid generate `.xmake` directory if be not in project ### Bugs fixed @@ -282,6 +283,7 @@ * [#73](https://github.com/tboox/xmake/issues/73): 尝试获取可执行文件路径来作为xmake的脚本目录 * 在`add_subdirs`中的子`xmake.lua`中,使用独立子作用域,避免作用域污染导致的干扰问题 * [#78](https://github.com/tboox/xmake/pull/78): 美化非全屏终端窗口下的`xmake --help`输出 +* 避免产生不必要的`.xmake`目录,如果不在工程中的时候 ### Bugs修复 diff --git a/xmake/core/main.lua b/xmake/core/main.lua index 8dda0a491..97c77ae43 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -180,7 +180,9 @@ function main.done() end -- save command lines to history - history.save("cmdlines", option.cmdline()) + if os.isfile(xmake._PROJECT_FILE) then + history.save("cmdlines", option.cmdline()) + end -- run task ok, errors = task.run(option.taskname() or "build") -- cgit v1.3.1