From 6e79b508b62dab67581c4553488cb9d401e9583b Mon Sep 17 00:00:00 2001 From: knaccc Date: Tue, 7 May 2019 20:05:50 +0100 Subject: [PATCH] uncompressed/compressed distribution size ASCII table generation for inclusion in README --- README.md | 17 +++++++++-------- bin/zip-all.sh | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 651b83b..4beb4b2 100755 --- a/README.md +++ b/README.md @@ -23,14 +23,15 @@ Download the latest binary releases for Mac/Windows/Linux here: https://github.c The zero-dependency distribution sizes are as follows: -OS | Uncompressed size (MB) | bz2 Compressed size (MB) ------------- | ------------- | ------------- -Linux | 50.5 | 32.0 -Mac | 39.2 | 26.0 -Windows | 40.2 | 29.0 -Linux GUI | 75.9 | 51.9 -Mac GUI | 61.5 | 45.0 -Windows GUI | 62.6 | 47.4 +OS | Uncompressed size (MB) | Compressed size (MB) +-------------- | ------------------------ | ------------------------ +Mac | 39.2 | 26.0 +Windows | 40.2 | 29.0 +Linux | 50.5 | 32.0 +Mac GUI | 61.5 | 45.0 +Windows GUI | 62.6 | 47.4 +Linux GUI | 75.9 | 51.9 + ## Building the launchers diff --git a/bin/zip-all.sh b/bin/zip-all.sh index 33a347e..9cbdc98 100755 --- a/bin/zip-all.sh +++ b/bin/zip-all.sh @@ -30,5 +30,22 @@ fi cd .. -du -sk dist/* | awk '{printf "%.1f MB %s\n",$1/1024,$2}' -du -sk dist-zip/* | awk '{printf "%.1f MB %s\n",$1/1024,$2}' \ No newline at end of file + +print3ColsJustified () { + printf "%-.14s %s" "$1 " "| " + printf "%-.26s %s" "$2 " "| " + printf "%s\n" "$3" +} +getDirSizeMB () { + du -sk $1 | awk '{printf "%.1f",$1/1024,$2}' +} + +print3ColsJustified "OS" "Uncompressed size (MB)" "Compressed size (MB)" +print3ColsJustified "------------------------" "------------------------" "------------------------" +print3ColsJustified "Mac" "`getDirSizeMB dist/mac`" "`getDirSizeMB dist-zip/i2p-zero-mac.v${VERSION}.tar.bz2`" +print3ColsJustified "Windows" "`getDirSizeMB dist/win`" "`getDirSizeMB dist-zip/i2p-zero-win.v${VERSION}.zip`" +print3ColsJustified "Linux" "`getDirSizeMB dist/linux`" "`getDirSizeMB dist-zip/i2p-zero-linux.v${VERSION}.tar.bz2`" +print3ColsJustified "Mac GUI" "`getDirSizeMB dist/mac-gui`" "`getDirSizeMB dist-zip/i2p-zero-mac-gui.v${VERSION}.tar.bz2`" +print3ColsJustified "Windows GUI" "`getDirSizeMB dist/win-gui`" "`getDirSizeMB dist-zip/i2p-zero-win-gui.v${VERSION}.zip`" +print3ColsJustified "Linux GUI" "`getDirSizeMB dist/linux-gui`" "`getDirSizeMB dist-zip/i2p-zero-linux-gui.v${VERSION}.tar.bz2`" +