Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions servers/scripts/build-maps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ done

git pull &>/dev/null
git add * &>/dev/null

ZIP_SIZE=$(du -sh --exclude=.git . | awk '{print $1}' | sed 's/G$/ GiB/;s/M$/ MiB/')
CLONE_SIZE=$(git count-objects -v | awk '
$1 == "size:" || $1 == "size-pack:" { total += $2 }
END {
if (total >= 1024 * 1024)
printf "%.1f GiB", total / (1024 * 1024)
else
printf "%.0f MiB", total / 1024
}
')
sed -i \
-e "/Download the ZIP/s/(about [^)]*)/(about $ZIP_SIZE)/" \
-e "/git clone/s/(about [^)]*)/(about $CLONE_SIZE)/" \
README.md

MAPS=$(git diff --name-status HEAD | grep '\.map')
if [ $? -eq 0 ]; then
git commit -a -m "$(echo "$MAPS" | grep '\.map' | sed -e 's#^\(.\).*/maps/\(.*\).map.*$#\1 \2,#' | tr '\n' ' ' | head -c -2)" &>/dev/null
Expand Down