Added Chinese version

Added Chinese version
This commit is contained in:
麦哲伦 2024-02-04 17:12:45 +08:00
parent d037338a23
commit 730a68b92a
466 changed files with 31255 additions and 0 deletions

View file

@ -0,0 +1,15 @@
import { readFile, writeFile } from 'fs/promises';
export { addToChangelog };
async function addToChangelog({ changelog, version, changelogPath = './CHANGELOG.md' }) {
const changelogContent = await readFile(changelogPath, 'utf-8');
const versionTitle = `## Version ${version}`;
if (changelogContent.includes(versionTitle)) {
throw new Error(`Version ${version} already exists in the changelog`);
}
const newChangeLogContent = changelogContent.replace('## ', `${versionTitle}\n\n${changelog}\n\n## `);
await writeFile(changelogPath, newChangeLogContent, 'utf-8');
}