🔧 fix(sync): avoid backtick expansion

This commit is contained in:
csh 2026-01-13 10:56:27 +08:00
parent 087b0b9c75
commit e5dd7d9d07
1 changed files with 8 additions and 8 deletions

View File

@ -128,11 +128,11 @@ if [ -n "$REL_SNAPSHOT" ]; then
[ -f "$md" ] || continue
tmp="$(mktemp 2>/dev/null || echo "$AGENTS_DST/.rewrite.$(basename "$md").$timestamp")"
sed \
-e "s#\`docs/tsl/#\`$DOCS_PREFIX/tsl/#g" \
-e "s#\`docs/cpp/#\`$DOCS_PREFIX/cpp/#g" \
-e "s#\`docs/python/#\`$DOCS_PREFIX/python/#g" \
-e "s#\`docs/markdown/#\`$DOCS_PREFIX/markdown/#g" \
-e "s#\`docs/common/#\`$DOCS_PREFIX/common/#g" \
-e 's#`docs/tsl/#`'"$DOCS_PREFIX"'/tsl/#g' \
-e 's#`docs/cpp/#`'"$DOCS_PREFIX"'/cpp/#g' \
-e 's#`docs/python/#`'"$DOCS_PREFIX"'/python/#g' \
-e 's#`docs/markdown/#`'"$DOCS_PREFIX"'/markdown/#g' \
-e 's#`docs/common/#`'"$DOCS_PREFIX"'/common/#g' \
"$md" >"$tmp"
mv "$tmp" "$md"
done
@ -187,7 +187,7 @@ fi
langs_line=""
for name in $agents_langs; do
entry="`.agents/$name/index.md`"
entry='`.agents/'"$name"'/index.md`'
if [ -z "$langs_line" ]; then
langs_line="$entry"
else
@ -197,8 +197,8 @@ done
{
printf "%s\n" "$AGENTS_BLOCK_START"
printf "%s\n\n" "请以 `.agents/` 下的规则为准:"
printf "%s\n" "- 入口:`.agents/index.md`"
printf "%s\n\n" '请以 `.agents/` 下的规则为准:'
printf "%s\n" '- 入口:`.agents/index.md`'
if [ -n "$langs_line" ]; then
printf "%s\n" "- 语言规则:$langs_line"
else