Update daily_README.yaml

This commit is contained in:
Alexandre
2022-12-02 14:12:43 +01:00
committed by GitHub
parent 44a4043c0b
commit fc00737aee

View File

@@ -88,18 +88,6 @@ jobs:
ICON=""
fi
# Number of users
DOWNLOADS=0
COUNT=0
ARCH=amd64 && SLUG=$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}') && \
COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && \
DOWNLOADS=$(( $DOWNLOADS + $COUNT))
echo "$DOWNLOADS amd64 users"
ARCH=aarch64
COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && \
echo "$COUNT aarch64 users"
DOWNLOADS=$(( $DOWNLOADS + $COUNT))
# Write infos
sed -i "$ADDONSLINE"'{G;}' README2.md
if [[ $(jq '.schema' "$f/config.json") == *"localdisks"* ]]; then sed -i "$ADDONSLINE"'a ![localdisks][localdisks-badge]' README2.md; fi
@@ -116,12 +104,12 @@ jobs:
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
sed -i "$ADDONSLINE"'a ![amd64][amd64-badge]' README2.md
ARCH=amd64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
echo "$COUNT armv7 users with $SLUG" && DOWNLOADS=$(( $DOWNLOADS + $COUNT))
echo "$COUNT amd64 users with $SLUG" && DOWNLOADS=$(( $DOWNLOADS + $COUNT))
else sed -i "$ADDONSLINE"'a ![amd64no][amd64no-badge]' README2.md; fi
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
sed -i "$ADDONSLINE"'a ![aarch64][aarch64-badge]' README2.md
ARCH=aarch64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
echo "$COUNT armv7 users with $SLUG" && DOWNLOADS=$(( $DOWNLOADS + $COUNT))
echo "$COUNT aarch64 users with $SLUG" && DOWNLOADS=$(( $DOWNLOADS + $COUNT))
else sed -i "$ADDONSLINE"'a ![aarch64no][aarch64no-badge]' README2.md; fi
if [[ -f "$f/updater.json" ]]; then sed -i "$ADDONSLINE"'a ![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2F'"$FOLDERNAME"'%2Fupdater.json)' README2.md; fi
sed -i "$ADDONSLINE"'a &emsp;&emsp;![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2F'"$FOLDERNAME"'%2Fconfig.json)' README2.md || true