Skip to content

Commit 9f331c7

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 703b152 commit 9f331c7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,21 @@ echo ""
553553
echo "LEARN:"
554554
echo " just tour Guided project tour"
555555
echo " just default List all recipes"
556+
557+
558+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
559+
crg-grade:
560+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
561+
[ -z "$$grade" ] && grade="X"; \
562+
echo "$$grade"
563+
564+
# Generate a shields.io badge markdown for the current CRG grade
565+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
566+
crg-badge:
567+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
568+
[ -z "$$grade" ] && grade="X"; \
569+
case "$$grade" in \
570+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
571+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
572+
*) color="lightgrey" ;; esac; \
573+
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)