From 8c37044233447d2d6559d598454650ff53db0ceb Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 14 Sep 2017 22:52:29 +0800 Subject: improve statistics --- scripts/installer.nsi | 2 +- xmake/actions/build/statistics.lua | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/installer.nsi b/scripts/installer.nsi index c87019b20..c7d17e896 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -79,7 +79,7 @@ Section "xmake (required)" Installer SetOutPath $INSTDIR ; Put file there - File /r /x ".DS_Store" "..\xmake\*.*" + File /r /x ".DS_Store" /x "*.swp" "..\xmake\*.*" File "..\*.md" File "..\core\build\xmake.exe" File /r /x ".DS_Store" "..\winenv" ; put bin\unzip, bin\curl diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua index 1d82c80e7..6efa272f5 100644 --- a/xmake/actions/build/statistics.lua +++ b/xmake/actions/build/statistics.lua @@ -27,7 +27,7 @@ import("core.base.option") -- post statistics info and only post once everyday when building each project -- --- clone the xmake-stats repo to update the traffic(git clones) info in github +-- clone the xmake-stats(only an empty repo) to update the traffic(git clones) info in github -- -- the traffic info in github (just be approximate numbers): -- @@ -56,11 +56,16 @@ function post() end end - -- post it in background - local proc = process.openv("xmake", argv, os.tmpfile() .. ".stats.log") - if proc ~= nil then - process.close(proc) - end + -- try to post it in background + try + { + function () + local proc = process.openv("xmake", argv, path.join(os.tmpdir(), projectname .. ".stats.log")) + if proc ~= nil then + process.close(proc) + end + end + } end -- the main function -- cgit v1.3.1