Fix grep portability bug and document doc-drift script in CLAUDE.md

- Use grep -rE (ERE) instead of BRE \| alternation for BSD/macOS compat
- Add doc-drift section to CLAUDE.md Testing section with usage and purpose

Nightshift-Task: doc-drift
Nightshift-Ref: https://github.com/marcus/nightshift
This commit is contained in:
2026-03-20 02:28:19 -04:00
parent 5ca15118f8
commit 508ba06e69
2 changed files with 7 additions and 1 deletions

View File

@@ -79,7 +79,7 @@ function apiRouteExists(routePath) {
const fragment = clean.replace(/^\/api/, '');
try {
const out = execSync(
`grep -r --include="*.js" -l "${clean}\\|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`,
`grep -rE --include="*.js" -l "${clean}|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`,
{ stdio: ['pipe', 'pipe', 'pipe'] }
).toString().trim();
return out.length > 0;