mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-17 00:33:45 +08:00
chore: replaceAll var
This commit is contained in:
parent
2ae9d25d44
commit
fb98c8f2ac
|
@ -285,14 +285,14 @@ export const updateReadMeMd = async (newConfig: SubscriptionConfig) => {
|
||||||
.join('\n');
|
.join('\n');
|
||||||
const mdTemplate = await fs.readFile(process.cwd() + '/Template.md', 'utf-8');
|
const mdTemplate = await fs.readFile(process.cwd() + '/Template.md', 'utf-8');
|
||||||
const readMeMdText = mdTemplate
|
const readMeMdText = mdTemplate
|
||||||
.replace('--APP_SIZE--', newConfig.apps.length.toString())
|
.replaceAll('--APP_SIZE--', newConfig.apps.length.toString())
|
||||||
.replace(
|
.replaceAll(
|
||||||
'--GROUP_SIZE--',
|
'--GROUP_SIZE--',
|
||||||
newConfig.apps
|
newConfig.apps
|
||||||
.reduce((p, c) => p + (c.groups?.length || 0), 0)
|
.reduce((p, c) => p + (c.groups?.length || 0), 0)
|
||||||
.toString(),
|
.toString(),
|
||||||
)
|
)
|
||||||
.replace('--VERSION--', (newConfig.version || 0).toString())
|
.replaceAll('--VERSION--', (newConfig.version || 0).toString())
|
||||||
.replace('--APP_LIST--', appListText);
|
.replaceAll('--APP_LIST--', appListText);
|
||||||
await fs.writeFile(process.cwd() + '/README.md', readMeMdText);
|
await fs.writeFile(process.cwd() + '/README.md', readMeMdText);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user