bookworm-smart-assistant/scripts/patches/patch-w1-disambig-count-88to89.js
Bookworm Admin b7a8e29d21 release: v6.7.0 - OTA E2E test release
- VERSION file as authoritative version source
- export.mjs reads VERSION with package.json fallback
- bw-ota.ps1 DryRun mode for safe testing
- auto-setup.ps1 bumped to v3.2.0 (Phase 8 OTA)
2026-04-27 17:59:44 +08:00

25 lines
853 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env node
// patch-w1-disambig-count-88to89.js — 幂等补丁: CLAUDE.md 消歧规则计数 88→89
const fs = require('fs');
const path = require('path');
const SENTINEL = '完整 89 条见';
const target = path.join(__dirname, '..', '..', 'CLAUDE.md');
const content = fs.readFileSync(target, 'utf-8');
if (content.includes(SENTINEL)) {
console.log('[SKIP] CLAUDE.md 已包含 "完整 89 条",无需修改');
process.exit(0);
}
const updated = content.replace('完整 88 条见', SENTINEL);
if (updated === content) {
console.log('[SKIP] 未找到 "完整 88 条见",可能已修改');
process.exit(0);
}
const bak = target + '.bak.' + new Date().toISOString().slice(0,10);
fs.copyFileSync(target, bak);
fs.writeFileSync(target, updated, 'utf-8');
console.log('[DONE] CLAUDE.md 消歧规则计数 88→89备份:', bak);