From addc41d619a9ca8efc6b676c1a33d93624a46961 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 13 Dec 2022 23:54:29 +0100 Subject: [PATCH] Update daily_README.yaml --- .github/workflows/daily_README.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily_README.yaml b/.github/workflows/daily_README.yaml index 27fe68753..79c831b7a 100644 --- a/.github/workflows/daily_README.yaml +++ b/.github/workflows/daily_README.yaml @@ -130,7 +130,11 @@ jobs: STATS_AMD64="$(awk '{SUM+=$4}END{print SUM}' Stats2)" STATS_AARCH64="$(awk '{SUM+=$5}END{print SUM}' Stats2)" STATS_DOWNLOADS="$(cat Stats | awk 'NR==2{print $1}')" - sed -i "s|%%STATS_DOWNLOADS%%|$STATS_DOWNLOADS ($STATS_AMD64 amd64, $STATS_AARCH64 aarch64, $STATS_ARMV7 armv7)|g" README2.md && \ + STATS_ARMV7="$(awk -v t1="$STATS_ARMV7" -v t2="$STATS_AMD64" -v t3="$STATS_AARCH64" 'BEGIN{printf "%.0f", t1/(t1+t2+t3) * 100}')" + STATS_AMD64="$(awk -v t1="$STATS_ARMV7" -v t2="$STATS_AMD64" -v t3="$STATS_AARCH64" 'BEGIN{printf "%.0f", t2/(t1+t2+t3) * 100}')" + STATS_AARCH64="$(awk -v t1="$STATS_ARMV7" -v t2="$STATS_AMD64" -v t3="$STATS_AARCH64" 'BEGIN{printf "%.0f", t3/(t1+t2+t3) * 100}')" + #echo $((100*$STATS_THREE/($STATS_ONE+$STATS_TWO+$STATS_THREE))) + sed -i "s|%%STATS_DOWNLOADS%%|$STATS_DOWNLOADS (amd64 $STATS_AMD64%,aarch64 $STATS_AARCH64%,armv7 $STATS_ARMV7%)|g" README2.md && \ sed -i "s|%%STATS_ADDONS%%|$(find . -name "config.json" | wc -l)|g" README2.md && \ STATS_ONE="$(cat Stats | awk 'NR==3{print $(NF)}')" && \ STATS_TWO="$(cat Stats | awk 'NR==4{print $(NF)}')" && \