Skip to content

Commit f5bffda

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

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
@@ -112,3 +112,21 @@ help-me:
112112
@echo " https://github.com/hyperpolymath/ipfs-overlay/issues/new"
113113
@echo ""
114114
@echo "Include the output of 'just doctor' in your report."
115+
116+
117+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
118+
crg-grade:
119+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
120+
[ -z "$$grade" ] && grade="X"; \
121+
echo "$$grade"
122+
123+
# Generate a shields.io badge markdown for the current CRG grade
124+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
125+
crg-badge:
126+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
127+
[ -z "$$grade" ] && grade="X"; \
128+
case "$$grade" in \
129+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
130+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
131+
*) color="lightgrey" ;; esac; \
132+
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)