fix:修改了各种md里的描述
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Deploy telemetry dashboard / deploy (push) Has been cancelled
Sync LobeHub models / sync (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Deploy telemetry dashboard / deploy (push) Has been cancelled
Sync LobeHub models / sync (push) Has been cancelled
This commit is contained in:
56
tools/icon_work/fix_md.py
Normal file
56
tools/icon_work/fix_md.py
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
import re, os
|
||||
|
||||
ROOT = r"D:\Project\Starlight_Lancher"
|
||||
FILES = [
|
||||
"CLAUDE.md",
|
||||
"CODE_OF_CONDUCT.md",
|
||||
"CONTRIBUTING.md",
|
||||
"apps/app/README.md",
|
||||
"apps/telemetry-dashboard/README.md",
|
||||
"apps/telemetry-worker/README.md",
|
||||
"apps/website/CLAUDE.md",
|
||||
"apps/website/README.md",
|
||||
"packages/assets/README.md",
|
||||
"standards/README.md",
|
||||
"standards/frontend/INTERNATIONALIZATION.md",
|
||||
"apps/app-frontend/src/lab/recipe-generator/THIRD_PARTY_NOTICES.md",
|
||||
]
|
||||
|
||||
SKIP_SUBSTR = [
|
||||
"axolotl:brand-guard", "axolotl:i18n-check", "axolotl-release", "axolotl-ci",
|
||||
"axolotl:brand", "//axolotl", "/axolotl/", "axolotl.local", "axolotl-launcher",
|
||||
"axolotl://", "garbage-human-studio", "red.ghs.axolotl",
|
||||
"github.com/Mystic-Stars/Axolotl", # 保留 Axolotl 仓库 URL
|
||||
"Axolotl-Launcher", # 保留 GitHub 组织名
|
||||
]
|
||||
|
||||
def transform(line):
|
||||
if any(s in line for s in SKIP_SUBSTR):
|
||||
return line
|
||||
out = re.sub(r"\bAxolotl Launcher\b", "Starlight Launcher", line)
|
||||
out = re.sub(r"\bAxolotl\b", "Starlight", out)
|
||||
return out
|
||||
|
||||
APPLY = True
|
||||
report = []
|
||||
for f in FILES:
|
||||
p = os.path.join(ROOT, f)
|
||||
try:
|
||||
text = open(p, encoding="utf-8").read()
|
||||
except Exception as e:
|
||||
print("跳过", f, e); continue
|
||||
lines = text.split("\n")
|
||||
changed = 0
|
||||
for i, line in enumerate(lines):
|
||||
new = transform(line)
|
||||
if new != line:
|
||||
report.append((f, i+1, line.strip(), new.strip()))
|
||||
lines[i] = new
|
||||
changed += 1
|
||||
if changed and APPLY:
|
||||
open(p, "w", encoding="utf-8", newline="\n").write("\n".join(lines))
|
||||
|
||||
print("已写入,受影响行数:", len(report))
|
||||
for f, ln, old, new in report:
|
||||
print(f"{f}:{ln} -> {new[:80]}")
|
||||
Reference in New Issue
Block a user