summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-04 15:46:37 +0800
committerruki <[email protected]>2017-05-04 15:46:37 +0800
commitb3e5d26680f6c72948b09c8156910ee580b65eb8 (patch)
tree73f2a868644633819a860fb2c24d16b93a6996c4
parent31de28277a4ed502cc544a9481c2128b592e3d60 (diff)
avoid generate .xmake directory
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/core/main.lua4
2 files changed, 5 insertions, 1 deletions
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")