mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 12:31:54 +08:00
Chore: better logging
This commit is contained in:
@@ -4,6 +4,8 @@ const path = require('path');
|
||||
const { isIP } = require('net');
|
||||
|
||||
(async () => {
|
||||
console.time('Total Time - build-anti-bogus-domain');
|
||||
console.time('* Download bogus-nxdomain-list')
|
||||
const res = (await (await fetchWithRetry('https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf')).text())
|
||||
.split('\n')
|
||||
.map(line => {
|
||||
@@ -14,6 +16,7 @@ const { isIP } = require('net');
|
||||
return null
|
||||
})
|
||||
.filter(ip => typeof ip === 'string' && isIP(ip) !== 0);
|
||||
console.timeEnd('* Download bogus-nxdomain-list')
|
||||
|
||||
const filePath = path.resolve(__dirname, '../List/ip/reject.conf');
|
||||
const content = (await fs.promises.readFile(filePath, 'utf-8'))
|
||||
@@ -23,4 +26,5 @@ const { isIP } = require('net');
|
||||
);
|
||||
|
||||
await fs.promises.writeFile(filePath, content, 'utf-8');
|
||||
console.timeEnd('Total Time - build-anti-bogus-domain');
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user