10 lines
No EOL
483 B
Bash
Executable file
10 lines
No EOL
483 B
Bash
Executable file
#!/bin/bash
|
|
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
|
cat <<EOF > coverage-badge.svg
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="98" height="20">
|
|
<rect width="59" height="20" fill="#555"/>
|
|
<rect x="59" width="39" height="20" fill="#4c1"/>
|
|
<text x="30" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
|
|
<text x="65" y="14" fill="#fff" font-family="Verdana" font-size="11">${COVERAGE}%</text>
|
|
</svg>
|
|
EOF |