test(hemar): many tests but not pass

This commit is contained in:
2025-12-09 13:49:43 +00:00
parent 73dc9aee9e
commit 6fb3ee1af8
10 changed files with 260 additions and 79 deletions

View File

@@ -503,6 +503,7 @@ if [ -z "${AS_LIBRARY+x}" ]; then
log notice "running"
AST=$(mktemp)
yq -o j -i "[]" "$AST"
AST_key='.'
trap 'rm -f "$AST"' EXIT INT HUP
@@ -578,10 +579,13 @@ if [ -z "${AS_LIBRARY+x}" ]; then
fi
buf=$(cat "$STAGE_BUFFER_1")
yq -o j -i "$AST_key += [{
\"type\": \"text\",
\"value\": \"$(json_escape "$buf")\"
}]" "$AST"
# Only add text element if buffer is not empty
if [ -n "$buf" ]; then
yq -o j -i "$AST_key += [{
\"type\": \"text\",
\"value\": \"$(json_escape "$buf")\"
}]" "$AST"
fi
fi
# return the output