mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-28 16:52:26 +01:00
Use awk for arch_list extraction to match build_from approach
Replace fragile sed '/^arch:/,/^[^ a]/p' pattern with the same awk block-parsing approach used for build_from. The sed pattern leaked lines from keys starting with 'a' (like audio:) into the range before grep filtered them out. The awk approach cleanly stops at the next top-level key. Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/d3d7f769-ce2d-4ddd-b066-7bb769754460
This commit is contained in:
6
.github/workflows/onpush_builder.yaml
vendored
6
.github/workflows/onpush_builder.yaml
vendored
@@ -167,7 +167,11 @@ jobs:
|
||||
image=$(grep -m1 '^image:' "config.$ext" | sed 's/^image:[[:space:]]*//' | tr -d "\"'")
|
||||
name=$(grep -m1 '^name:' "config.$ext" | sed 's/^name:[[:space:]]*//' | tr -d "\"'")
|
||||
description=$(grep -m1 '^description:' "config.$ext" | sed 's/^description:[[:space:]]*//' | tr -d "\"'")
|
||||
arch_list=$(sed -n '/^arch:/,/^[^ a]/p' "config.$ext" | grep '^ *-' | sed 's/^ *- *//' | tr -d "\"'" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
arch_list=$(awk '
|
||||
/^arch:/ { inblock=1; next }
|
||||
/^[^[:space:]]/ { if (inblock) exit }
|
||||
inblock && /^[[:space:]]/ { print }
|
||||
' "config.$ext" | sed 's/^ *- *//' | tr -d "\"'" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
fi
|
||||
break
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user