Skip to content

Commit 0e7c1d8

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 237c231 commit 0e7c1d8

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
@@ -954,3 +954,21 @@ help-me:
954954
@echo " https://github.com/hyperpolymath/vscode-a2ml/issues/new"
955955
@echo ""
956956
@echo "Include the output of 'just doctor' in your report."
957+
958+
959+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
960+
crg-grade:
961+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
962+
[ -z "$$grade" ] && grade="X"; \
963+
echo "$$grade"
964+
965+
# Generate a shields.io badge markdown for the current CRG grade
966+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
967+
crg-badge:
968+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
969+
[ -z "$$grade" ] && grade="X"; \
970+
case "$$grade" in \
971+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
972+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
973+
*) color="lightgrey" ;; esac; \
974+
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)