- Add credentialManager, totpConfig, saveTotpConfig, session to deps - Create ctx shim for backward compatibility - Fix hasOwnProperty anti-pattern (use Object.prototype.hasOwnProperty.call) Result: 54 errors → 0 errors
14 lines
469 B
Bash
14 lines
469 B
Bash
#!/bin/bash
|
|
# Systematically fix ctx.* references in all route files
|
|
|
|
cd /root/.openclaw/agents/main/workspace/dashcaddy-work/dashcaddy-api
|
|
|
|
# Find all route files with ctx errors
|
|
echo "Finding routes with ctx errors..."
|
|
for file in $(find routes -name "*.js" -type f | grep -v index.js | grep -v helpers.js); do
|
|
errors=$(npx eslint "$file" 2>&1 | grep -c "'ctx' is not defined")
|
|
if [ "$errors" -gt 0 ]; then
|
|
echo "$errors errors in $file"
|
|
fi
|
|
done | sort -rn
|