Files

15 lines
1004 B
JavaScript
Raw Permalink Normal View History

import { readFileSync, writeFileSync } from 'node:fs';
function patch(p, fn) {
const f = 'parts/' + p;
const t = readFileSync(f, 'utf8');
const n = fn(t);
if (n !== t) { writeFileSync(f, n, 'utf8'); console.log('patched ' + p); } else console.log('nochange ' + p);
}
patch('01-overview.md', (t) => t.replace('OOBE 完成后写 `settings.json` 的', 'OOBE 完成后写 `config.json`(并兼容导出 ClassIsland 的 `Settings.json`)的'));
patch('07-notifications.md', (t) => t.replace('持久化在 `Settings.json`(字段', '持久化在 `config.json`(ClassIsland 原生写入 `Settings.json`,字段'));
patch('10-settings.md', (t) =>
t
.replace('必须**立刻**把整个 `Settings.json` 写盘', '必须**立刻**把整个配置(`config.json`,ClassIsland 对应 `Settings.json`)写盘')
.replace('且 `Settings.json` 中 `Opacity` 为', '且 `config.json` 中 `opacity` 为')
.replace('可用 `Settings.json` 全文比对', '可用 `config.json` 全文比对'),
);