mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-09 17:15:57 +02:00
Update daily_README.yaml
This commit is contained in:
22
.github/workflows/daily_README.yaml
vendored
22
.github/workflows/daily_README.yaml
vendored
@@ -15,10 +15,24 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Run script file
|
- name: Run script file
|
||||||
run: |
|
run: |
|
||||||
|
# Init
|
||||||
echo "Starting"
|
echo "Starting"
|
||||||
|
|
||||||
|
# Prepare template
|
||||||
cp .templates/.README.md README2.md
|
cp .templates/.README.md README2.md
|
||||||
ADDONSLINE=$(sed -n '/%%ADDONS_LIST%%/=' README2.md)
|
ADDONSLINE=$(sed -n '/%%ADDONS_LIST%%/=' README2.md)
|
||||||
sed -i "/**ADDONS_LIST%%/d" README2.md
|
sed -i "/**ADDONS_LIST%%/d" README2.md
|
||||||
|
|
||||||
|
# Sort folders by addon name
|
||||||
|
for f in $( find -- * -type d | sort -r ); do
|
||||||
|
if [ -f "$f"/config.json ]; then
|
||||||
|
echo "$f" > "$f"/oldname
|
||||||
|
NAME=$(jq -r '.name' "$f"/config.json)
|
||||||
|
mv "$f" "NAME"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Populate template
|
||||||
for f in $( find -- * -type d | sort -r ); do
|
for f in $( find -- * -type d | sort -r ); do
|
||||||
# $f is an addon directory
|
# $f is an addon directory
|
||||||
if [ -f "$f"/config.json ]; then
|
if [ -f "$f"/config.json ]; then
|
||||||
@@ -38,6 +52,14 @@ jobs:
|
|||||||
sed -i "$ADDONSLINE"'a ✓ ['"$NAME"']('"$f"'/) : '"$DESCRIPTION\\n" README2.md
|
sed -i "$ADDONSLINE"'a ✓ ['"$NAME"']('"$f"'/) : '"$DESCRIPTION\\n" README2.md
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Restore folders name
|
||||||
|
for f in $( find -- * -type d | sort -r ); do
|
||||||
|
if [ -f "$f"/config.json ]; then
|
||||||
|
mv "$f" "$(cat "$f"/oldname)
|
||||||
|
fi
|
||||||
|
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