From 770c135161e4ad156489dc39d8d246440351e87e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 17 Dec 2022 08:18:09 +0100 Subject: [PATCH] Update weekly_stats.yaml --- .github/workflows/weekly_stats.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/weekly_stats.yaml b/.github/workflows/weekly_stats.yaml index 76dcbd6b0..3befb4951 100644 --- a/.github/workflows/weekly_stats.yaml +++ b/.github/workflows/weekly_stats.yaml @@ -66,22 +66,22 @@ jobs: done fi # Add data - sed -i "/$SLUG/s|^-|$DOWNLOADS|" "$file" + sed -i "/${SLUG}$/s|^-|$DOWNLOADS|" "$file" fi done # Add total SLUG=TOTAL - if ! grep -q "$SLUG" "$file"; then + if ! grep -q "$SLUG$" "$file"; then sed -i "1a$SLUG" "$file" # shellcheck disable=SC2046 for i in $(seq $(head -n 1 $file | tr -cd ' \t' | wc -c )); do echo "$i" - sed -i "/$SLUG/s|^|- |" "$file" + sed -i "/$SLUG$/s|^|- |" "$file" done fi DOWNLOADS="$(awk 'FNR > 2 {SUM+=$1}END{print SUM}' Stats)" - sed -i "/$SLUG/s|^-|$DOWNLOADS|" "$file" + sed -i "/$SLUG$/s|^-|$DOWNLOADS|" "$file" # Sort file (head -n 2 "$file" && tail -n +3 "$file" | sort -k1 -r -n) > tmp && mv tmp "$file"