feat: refactor work item file retrieval to use Python script for improved error handling and readability
This commit is contained in:
@@ -40,7 +40,28 @@ Latest Mattermost context, if available:
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
Requirements:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user