Skip to content

Commit 0648d93

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent c054530 commit 0648d93

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
@@ -910,3 +910,21 @@ maint-assault:
910910
build-riscv:
911911
@echo "Building for RISC-V..."
912912
cross build --target riscv64gc-unknown-linux-gnu
913+
914+
915+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
916+
crg-grade:
917+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
918+
[ -z "$$grade" ] && grade="X"; \
919+
echo "$$grade"
920+
921+
# Generate a shields.io badge markdown for the current CRG grade
922+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
923+
crg-badge:
924+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
925+
[ -z "$$grade" ] && grade="X"; \
926+
case "$$grade" in \
927+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
928+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
929+
*) color="lightgrey" ;; esac; \
930+
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)