diff options
| author | ruki <[email protected]> | 2022-05-11 22:48:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-11 22:48:34 +0800 |
| commit | 93a57b9ed86c527b4a3536d93487905d0f87a44d (patch) | |
| tree | b5707efdfd42b9fd9240ee62fcece5a09e3dcc24 | |
| parent | 00c362f3009600660daa5ef00ea3c6f38069c2a5 (diff) | |
show sync tips
| -rw-r--r-- | xmake/modules/private/service/remote_build/client.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua index 12cfb7a30..bd0938a4c 100644 --- a/xmake/modules/private/service/remote_build/client.lua +++ b/xmake/modules/private/service/remote_build/client.lua @@ -421,16 +421,27 @@ end -- send diff files function remote_build_client:_send_diff_files(stream, diff_files) + local count = 0 + local totalsize = 0 for _, fileitem in ipairs(diff_files.inserted) do - if not stream:send_file(fileitem, {compress = os.filesize(fileitem) > 4096}) then + local filesize = os.filesize(fileitem) + vprint("sending %s, %d bytes ..", fileitem, filesize) + if not stream:send_file(fileitem, {compress = filesize > 4096}) then return false end + count = count + 1 + totalsize = totalsize + filesize end for _, fileitem in ipairs(diff_files.modified) do - if not stream:send_file(fileitem, {compress = os.filesize(fileitem) > 4096}) then + local filesize = os.filesize(fileitem) + vprint("sending %s, %d bytes ..", fileitem, filesize) + if not stream:send_file(fileitem, {compress = filesize > 4096}) then return false end + count = count + 1 + totalsize = totalsize + filesize end + cprint("${bright}%d${clear} files, ${bright}%d${clear} bytes are uploaded.", count, totalsize) return stream:flush() end |
