diff options
| author | ruki <[email protected]> | 2017-09-14 23:13:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-09-14 13:23:46 +0800 |
| commit | c3e4d58ae5f23e9dd1d653197a255eab20d9c7ab (patch) | |
| tree | 88707326d720c13656518b85f4d9deb8c0e54336 | |
| parent | 8c37044233447d2d6559d598454650ff53db0ceb (diff) | |
improve statistics and avoid repeat
| -rw-r--r-- | xmake/actions/build/statistics.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua index 6efa272f5..993b95b9f 100644 --- a/xmake/actions/build/statistics.lua +++ b/xmake/actions/build/statistics.lua @@ -41,10 +41,14 @@ function post() -- has been posted today or statistics is disable? local outputdir = path.join(os.tmpdir(), "stats", os.date("%y%m%d"), projectname) - if os.isdir(outputdir) or os.getenv("XMAKE_STATS") == "disable" then + local markfile = outputdir .. ".mark" + if os.isdir(outputdir) or os.isfile(markfile) or os.getenv("XMAKE_STATS") == "disable" then return end + -- mark as posted first, avoid to post it repeatly + io.writefile(markfile, "ok") + -- init argument list local argv = {"lua", path.join(os.scriptdir(), "statistics.lua")} for _, name in ipairs({"root", "file", "project", "backtrace", "verbose", "quiet"}) do |
