Skip to content

Commit 7f875de

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 342f126 commit 7f875de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,21 @@ echo ""
161161
echo "LEARN:"
162162
echo " just tour Guided project tour"
163163
echo " just default List all recipes"
164+
165+
166+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
167+
crg-grade:
168+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
169+
[ -z "$$grade" ] && grade="X"; \
170+
echo "$$grade"
171+
172+
# Generate a shields.io badge markdown for the current CRG grade
173+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
174+
crg-badge:
175+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
176+
[ -z "$$grade" ] && grade="X"; \
177+
case "$$grade" in \
178+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
179+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
180+
*) color="lightgrey" ;; esac; \
181+
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"

0 commit comments

Comments
 (0)