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:
@@ -5,7 +5,7 @@ const { parseFelixDnsmasq } = require('./lib/parse-dnsmasq');
|
||||
const { runner } = require('./lib/trace-runner');
|
||||
const { compareAndWriteFile } = require('./lib/create-file');
|
||||
|
||||
runner(__filename, async () => {
|
||||
const buildInternalChnDomains = async () => {
|
||||
const [result] = await Promise.all([
|
||||
parseFelixDnsmasq('https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf'),
|
||||
fse.ensureDir(path.resolve(__dirname, '../List/internal'))
|
||||
@@ -15,4 +15,10 @@ runner(__filename, async () => {
|
||||
result.map(line => `SUFFIX,${line}`),
|
||||
path.resolve(__dirname, '../List/internal/accelerated-china-domains.txt')
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.buildInternalChnDomains = buildInternalChnDomains;
|
||||
|
||||
if (require.main === module) {
|
||||
runner(__filename, buildInternalChnDomains);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user