Skip to content

Commit d664add

Browse files
authored
chore: More robust coverage badge generation. (#215)
1 parent 97112fd commit d664add

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

scripts/generate-coverage-badge.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ elif [ "$TOTAL_COVERAGE" -gt 0 ]; then
1313
COLOR="#e05d44"
1414
fi
1515

16-
cat << EOF > "${1:-.}/coverage.json"
16+
COVERAGE_JSON_DIR=${1:-.}
17+
mkdir -p "$COVERAGE_JSON_DIR"
18+
19+
cat << EOF > "${COVERAGE_JSON_DIR}/coverage.json"
1720
{
1821
"schemaVersion": 1,
1922
"label": "coverage",

template/scripts/generate-coverage-badge.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ elif [ "$TOTAL_COVERAGE" -gt 0 ]; then
1313
COLOR="#e05d44"
1414
fi
1515

16-
cat << EOF > "${1:-.}/coverage.json"
16+
COVERAGE_JSON_DIR=${1:-.}
17+
mkdir -p "$COVERAGE_JSON_DIR"
18+
19+
cat << EOF > "${COVERAGE_JSON_DIR}/coverage.json"
1720
{
1821
"schemaVersion": 1,
1922
"label": "coverage",

0 commit comments

Comments
 (0)