Skip to content

Commit 21e0a8b

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 2708062 commit 21e0a8b

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
@@ -1393,3 +1393,21 @@ help-me:
13931393
echo " docs/ARCHITECTURE.md Architecture overview"
13941394
echo " QUICKSTART-USER.adoc Quick start for users"
13951395
echo " .machine_readable/STATE.a2ml Current project state"
1396+
1397+
1398+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
1399+
crg-grade:
1400+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
1401+
[ -z "$$grade" ] && grade="X"; \
1402+
echo "$$grade"
1403+
1404+
# Generate a shields.io badge markdown for the current CRG grade
1405+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
1406+
crg-badge:
1407+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
1408+
[ -z "$$grade" ] && grade="X"; \
1409+
case "$$grade" in \
1410+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
1411+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
1412+
*) color="lightgrey" ;; esac; \
1413+
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)