From 081f4867477b4cdade1269abf70eac8d273ceab7 Mon Sep 17 00:00:00 2001 From: lisonge Date: Sun, 19 Nov 2023 00:21:17 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppListTemplate.md | 3 +++ Template.md | 6 ++---- src/file.ts | 11 +++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 AppListTemplate.md diff --git a/AppListTemplate.md b/AppListTemplate.md new file mode 100644 index 00000000..88110279 --- /dev/null +++ b/AppListTemplate.md @@ -0,0 +1,3 @@ +# 适配 APP 列表 + +--APP_LIST-- diff --git a/Template.md b/Template.md index 3b2f0a4f..16d50530 100644 --- a/Template.md +++ b/Template.md @@ -6,12 +6,10 @@ GKD 默认订阅规则 当前订阅文件已适配 --APP_SIZE-- 个 APP, 共有 --GROUP_SIZE-- 规则组 +查看 [适配 APP 列表](./AppList.md) + 如何编写订阅/贡献此项目 -> [CONTRIBUTING.md](./CONTRIBUTING.md) -## 适配 APP 列表 - ---APP_LIST-- - ## 感谢以下开发者的贡献 ![img](https://contrib.rocks/image?repo=gkd-kit/subscription&_v=--VERSION--) diff --git a/src/file.ts b/src/file.ts index 5619f8f9..cae35348 100644 --- a/src/file.ts +++ b/src/file.ts @@ -343,7 +343,14 @@ export const updateReadMeMd = async ( .reduce((p, c) => p + (c.groups?.length || 0), 0) .toString(), ) - .replaceAll('--VERSION--', (newConfig.version || 0).toString()) - .replaceAll('--APP_LIST--', appListText); + .replaceAll('--VERSION--', (newConfig.version || 0).toString()); await fs.writeFile(process.cwd() + '/README.md', readMeMdText); + const appListTemplateMd = await fs.readFile( + process.cwd() + '/AppListTemplate.md', + 'utf-8', + ); + await fs.writeFile( + process.cwd() + '/AppList.md', + appListTemplateMd.replaceAll('--APP_LIST--', appListText), + ); };