validate_doc_paths.sh 用于 CI/本地检查废弃根路径;五图 HTML 对齐 6、测试/scripts。 Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
893 B
Bash
Executable File
18 lines
893 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# 校验活跃文档中是否仍引用已废弃「根目录」路径
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
|
cd "$ROOT"
|
|
SELF="开发文档/6、测试/scripts/validate_doc_paths.sh"
|
|
PAT='docs/gitea/|docs/wiki-gitea/|verification_screenshots/|python3 tools/|`tools/|bash docs/gitea'
|
|
EXCLUDE='工作日志\.md|110项功能逐项确认|开发文档结构规范/SKILL\.md|00-项目总览|legacy/|机擎/阿服/local-mount-sync|validate_doc_paths\.sh|live_verify_20260518|6、测试/README\.md'
|
|
hits=$(rg -l "$PAT" 开发文档 机擎 sdk README.md 2>/dev/null | rg -v "$EXCLUDE" || true)
|
|
if [ -n "$hits" ]; then
|
|
echo "❌ 发现残留旧路径:"
|
|
echo "$hits"
|
|
rg -n "$PAT" $hits 2>/dev/null | head -20
|
|
exit 1
|
|
fi
|
|
echo "✅ 活跃文档无废弃根路径引用"
|
|
python3 "开发文档/8、部署/04-Gitea门户/gitea/publish_wiki.py" --check-only
|