#!/bin/sh template() { artifacts=$(echo "$1" | head -n1 | cut -d ';' -f1) toy=$(echo "$1" | head -n1 | cut -d ';' -f2) item=$(echo "$1" | head -n1 | cut -d ';' -f3) status=$(echo "$1" | head -n1 | cut -d ';' -f4) content1=$(echo "$1" | head -n1 | cut -d ';' -f5-) content2=$(echo "$1" | tail -n+2) content=$(printf '%s\n%s\n' "$content1" "$content2" | sed -E 's/ ([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{9}\+[0-9]{2}:[0-9]{2})/\n\1/g') cat < EOF printf '\t\ttoymaker::%s/%s\n' "$toy" "$item" cat < * { box-sizing: border-box; } a { color: #00afff; } a:hover { background-color: #db9d3b; color: #000000; }
toymaker
EOF printf '\t\t\t

%s/%s

\n' "$toy" "$toy" "$item" if [ "$status" = '0' ] then printf '\t\t\t

OK

\n' elif [ "$status" = 'r' ] then printf '\t\t\t

Running

\n' else printf '\t\t\t

Error

\n' fi if [ -n "$artifacts" ] then printf '\t\t\t
\n' printf '\t\t\t\tartifacts\n' printf '\t\t\t\t
    \n' for artifact in $artifacts do printf '\t\t\t\t\t
  • %s
  • \n' "$toy" "$item" "$artifact" "$artifact" done printf '\t\t\t
' fi printf '\t\t\t
\n'
	printf '%s' "$content"
	printf '\t\t\t
\n' cat < EOF }