Compare commits

..

3 Commits

Author SHA1 Message Date
csh 07583c8283 🐛 fix(tests): make doc link check awk-portable 2026-01-08 15:44:39 +08:00
csh 6244aa39da 🔧 chore(ci): relax gitattributes check 2026-01-08 15:40:50 +08:00
csh 31dd0c5a38 🐛 fix(scripts): require existing project root 2026-01-08 15:39:09 +08:00
3 changed files with 17 additions and 6 deletions

View File

@ -212,7 +212,9 @@ jobs:
overall_fail=1
fi
if grep -q "# BEGIN playbook .gitattributes" .gitattributes 2>/dev/null; then
if grep -q "# BEGIN playbook .gitattributes" .gitattributes 2>/dev/null \
|| grep -q "# Added from playbook .gitattributes" .gitattributes 2>/dev/null \
|| grep -q "^\\* text=auto eol=lf" .gitattributes 2>/dev/null; then
echo "✅ .gitattributes 更新成功"
else
echo "❌ .gitattributes 更新失败"

View File

@ -54,7 +54,10 @@ fi
timestamp="$(date +%Y%m%d%H%M%S 2>/dev/null || echo bak)"
mkdir -p "$PROJECT_ROOT"
if [ ! -d "$PROJECT_ROOT" ]; then
echo "ERROR: project root does not exist: $PROJECT_ROOT" >&2
exit 1
fi
PROJECT_ROOT_ABS="$(CDPATH= cd -- "$PROJECT_ROOT" && pwd -P)"
DEST_PREFIX="$PROJECT_ROOT_ABS/docs/standards/playbook"
DEST_STANDARDS="$PROJECT_ROOT_ABS/docs/standards"

View File

@ -100,13 +100,19 @@ extract_links() {
gsub(/`[^`]*`/, "", line)
while (match(line, /\[[^]]+\]\(([^)]+)\)/, m)) {
print NR "\t" m[1]
while (match(line, /\[[^]]+\]\([^)]*\)/)) {
link = substr(line, RSTART, RLENGTH)
sub(/^\[[^]]+\]\(/, "", link)
sub(/\)$/, "", link)
print NR "\t" link
line = substr(line, RSTART + RLENGTH)
}
if (match(line, /^\[[^]]+\]:[[:space:]]*(.+)/, ref)) {
print NR "\t" ref[1]
if (match(line, /^\[[^]]+\]:[[:space:]]*[^[:space:]]+/)) {
link = substr(line, RSTART, RLENGTH)
sub(/^\[[^]]+\]:[[:space:]]*/, "", link)
sub(/[[:space:]].*$/, "", link)
print NR "\t" link
}
}
' "$1"