mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-18 05:19:11 +02:00
Update daily_README.yaml
This commit is contained in:
13
.github/workflows/daily_README.yaml
vendored
13
.github/workflows/daily_README.yaml
vendored
@@ -34,8 +34,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Sort yaml
|
# Sort yaml
|
||||||
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
||||||
|
|
||||||
@@ -50,17 +48,18 @@ jobs:
|
|||||||
sed -i "/**ADDONS_LIST%%/d" README2.md
|
sed -i "/**ADDONS_LIST%%/d" README2.md
|
||||||
|
|
||||||
# Sort folders by addon name
|
# Sort folders by addon name
|
||||||
|
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||||
for f in $(dirname "$(find -- */config.json -maxdepth 0 -type d | sort -r )"); do
|
if [ -f "$f"/config.json ]; then
|
||||||
NAME=$(jq -r '.name' "$f"/config.json)
|
NAME=$(jq -r '.name' "$f"/config.json)
|
||||||
if [[ "$f" != "$NAME" ]]; then
|
if [[ "$f" != "$NAME" ]]; then
|
||||||
echo "$f" > "$f"/oldname
|
echo "$f" > "$f"/oldname
|
||||||
mv "$f" "$NAME"
|
mv "$f" "$NAME"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Populate template
|
# Populate template
|
||||||
for f in $(find -- */config.json -maxdepth 0 -type d | sort -r ); do
|
find -- * -maxdepth 0 -type d | sort -r | while read -r f; do
|
||||||
# $f is an addon directory
|
# $f is an addon directory
|
||||||
if [ -f "$f/config.json" ]; then
|
if [ -f "$f/config.json" ]; then
|
||||||
|
|
||||||
@@ -70,7 +69,6 @@ jobs:
|
|||||||
if [ -f "$f/oldname" ]; then FOLDERNAME="$(cat "$f/oldname")"; else FOLDERNAME="$f"; fi
|
if [ -f "$f/oldname" ]; then FOLDERNAME="$(cat "$f/oldname")"; else FOLDERNAME="$f"; fi
|
||||||
NAME=$(jq -r '.name' "$f/config.json")
|
NAME=$(jq -r '.name' "$f/config.json")
|
||||||
DESCRIPTION=$(jq -r '.description' "$f/config.json")
|
DESCRIPTION=$(jq -r '.description' "$f/config.json")
|
||||||
|
|
||||||
# Get icon
|
# Get icon
|
||||||
if [ "$(jq '.panel_icon' "$f/config.json")" != null ]; then
|
if [ "$(jq '.panel_icon' "$f/config.json")" != null ]; then
|
||||||
ICON="$(jq -r '.panel_icon' "$f/config.json")"
|
ICON="$(jq -r '.panel_icon' "$f/config.json")"
|
||||||
@@ -79,7 +77,6 @@ jobs:
|
|||||||
else
|
else
|
||||||
ICON=""
|
ICON=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Write infos
|
# Write infos
|
||||||
sed -i "$ADDONSLINE"'{G;}' README2.md
|
sed -i "$ADDONSLINE"'{G;}' README2.md
|
||||||
if [[ $(jq '.schema' "$f/config.json") == *"localdisks"* ]]; then sed -i "$ADDONSLINE"'a ![localdisks][localdisks-badge]' README2.md; fi
|
if [[ $(jq '.schema' "$f/config.json") == *"localdisks"* ]]; then sed -i "$ADDONSLINE"'a ![localdisks][localdisks-badge]' README2.md; fi
|
||||||
@@ -95,7 +92,6 @@ jobs:
|
|||||||
sed -i "$ADDONSLINE"'a ✓ '"$ICON"' ['"$NAME"']('"$FOLDERNAME"'/) : '"$DESCRIPTION\\n" README2.md
|
sed -i "$ADDONSLINE"'a ✓ '"$ICON"' ['"$NAME"']('"$FOLDERNAME"'/) : '"$DESCRIPTION\\n" README2.md
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Restore folders name
|
# Restore folders name
|
||||||
find -- * -maxdepth 0 -type d | sort -r | while read -r f; do
|
find -- * -maxdepth 0 -type d | sort -r | while read -r f; do
|
||||||
if [ -f "$f/oldname" ]; then
|
if [ -f "$f/oldname" ]; then
|
||||||
@@ -104,7 +100,6 @@ jobs:
|
|||||||
mv "$f" "$NAME"
|
mv "$f" "$NAME"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Replace template if change
|
# Replace template if change
|
||||||
if [[ "$(stat -c%s "README2.md")" == "$(stat -c%s "README.md")" ]]; then
|
if [[ "$(stat -c%s "README2.md")" == "$(stat -c%s "README.md")" ]]; then
|
||||||
echo "no changes"
|
echo "no changes"
|
||||||
|
|||||||
Reference in New Issue
Block a user