Skip to content

Commit d27f09f

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent c2700a3 commit d27f09f

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
@@ -178,3 +178,21 @@ help-me:
178178
@echo " https://github.com/hyperpolymath/developer-ecosystem/issues/new"
179179
@echo ""
180180
@echo "Include the output of 'just doctor' in your report."
181+
182+
183+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
184+
crg-grade:
185+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
186+
[ -z "$$grade" ] && grade="X"; \
187+
echo "$$grade"
188+
189+
# Generate a shields.io badge markdown for the current CRG grade
190+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
191+
crg-badge:
192+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
193+
[ -z "$$grade" ] && grade="X"; \
194+
case "$$grade" in \
195+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
196+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
197+
*) color="lightgrey" ;; esac; \
198+
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)