diff options
| author | ruki <[email protected]> | 2020-06-02 23:01:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-02 12:10:19 +0800 |
| commit | eafcb33f997146804594f3e6cd404c7d658ee1b0 (patch) | |
| tree | 3bed1c5b689d11c64178c49cabc3867ed5533a81 /xmake/core/main.lua | |
| parent | b3152c7b10a6709224d51e18ca9b1700905dae86 (diff) | |
improve to save history
Diffstat (limited to 'xmake/core/main.lua')
| -rw-r--r-- | xmake/core/main.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua index ea85a605e..5e9b91b33 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -35,6 +35,7 @@ local colors = require("base/colors") local process = require("base/process") local scheduler = require("base/scheduler") local theme = require("theme/theme") +local config = require("project/config") local project = require("project/project") local history = require("project/history") --local profiler = require("base/profiler") @@ -263,9 +264,9 @@ Or you can add `--root` option or XMAKE_ROOT=y to allow run as root temporarily. return main._exit() end - -- save command lines to history + -- save command lines to history and we need to make sure that the .xmake directory is not generated everywhere local skip_history = (os.getenv('XMAKE_SKIP_HISTORY') or ''):trim() - if os.projectfile() and os.isfile(os.projectfile()) and skip_history == '' then + if os.projectfile() and os.isfile(os.projectfile()) and os.isdir(config.directory()) and skip_history == '' then history("local.history"):save("cmdlines", option.cmdline()) end |
