mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-20 00:35:17 +08:00
feat: 新增仅开屏广告的订阅
This commit is contained in:
13
src/file.ts
13
src/file.ts
@@ -77,6 +77,19 @@ export const writeConfig = async (config: SubscriptionConfig) => {
|
||||
const buffer = Buffer.from(orderdStringify(newConfig, sortKeys), 'utf-8');
|
||||
await fs.writeFile(gkdFp, buffer);
|
||||
|
||||
// update gkd.openad.json
|
||||
const onlyOpenAdConfig = _.cloneDeep(newConfig);
|
||||
onlyOpenAdConfig.apps.forEach((a) => {
|
||||
a.groups?.forEach((g) => {
|
||||
g.enable = g.name.startsWith('开屏广告');
|
||||
});
|
||||
});
|
||||
await fs.writeFile(
|
||||
process.cwd() + '/dist/gkd.openad.json',
|
||||
orderdStringify(onlyOpenAdConfig, sortKeys),
|
||||
'utf-8',
|
||||
);
|
||||
|
||||
// update gkd.version.json
|
||||
await fs.writeFile(
|
||||
versionFp,
|
||||
|
||||
Reference in New Issue
Block a user