mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Refactor/Chore: prepare build infra for further optimization
This commit is contained in:
@@ -6,7 +6,7 @@ const { processLine } = require('./lib/process-line');
|
||||
const { createRuleset } = require('./lib/create-file');
|
||||
const { runner } = require('./lib/trace-runner');
|
||||
|
||||
runner(__filename, async () => {
|
||||
const buildTelegramCIDR = async () => {
|
||||
/** @type {Response} */
|
||||
const resp = await fetchWithRetry('https://core.telegram.org/resources/cidr.txt');
|
||||
const lastModified = resp.headers.get('last-modified');
|
||||
@@ -49,4 +49,10 @@ runner(__filename, async () => {
|
||||
path.resolve(__dirname, '../List/ip/telegram.conf'),
|
||||
path.resolve(__dirname, '../Clash/ip/telegram.txt')
|
||||
));
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.buildTelegramCIDR = buildTelegramCIDR;
|
||||
|
||||
if (require.main === module) {
|
||||
runner(__filename, buildTelegramCIDR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user