Skip to content

Commit 63b6669

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 687e278 commit 63b6669

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
@@ -85,3 +85,21 @@ help-me:
8585
@echo " https://github.com/hyperpolymath/reasonably-good-token-vault/issues/new"
8686
@echo ""
8787
@echo "Include the output of 'just doctor' in your report."
88+
89+
90+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
91+
crg-grade:
92+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
93+
[ -z "$$grade" ] && grade="X"; \
94+
echo "$$grade"
95+
96+
# Generate a shields.io badge markdown for the current CRG grade
97+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
98+
crg-badge:
99+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
100+
[ -z "$$grade" ] && grade="X"; \
101+
case "$$grade" in \
102+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
103+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
104+
*) color="lightgrey" ;; esac; \
105+
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)