mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: speed up public folder setup / remove unused mkdir call
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { fetchRemoteTextAndReadByLine } from './lib/fetch-text-by-line';
|
||||
import { processLineFromReadline } from './lib/process-line';
|
||||
import path from 'path';
|
||||
import fsp from 'fs/promises';
|
||||
import { task } from './lib/trace-runner';
|
||||
|
||||
import { exclude, merge } from 'fast-cidr-tools';
|
||||
@@ -27,10 +26,7 @@ const RESERVED_IPV4_CIDR = [
|
||||
];
|
||||
|
||||
export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
|
||||
const cidr = (await Promise.all([
|
||||
processLineFromReadline(await fetchRemoteTextAndReadByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt')),
|
||||
fsp.mkdir(path.resolve(import.meta.dir, '../List/internal'), { recursive: true })
|
||||
]))[0];
|
||||
const cidr = await processLineFromReadline(await fetchRemoteTextAndReadByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt'));
|
||||
|
||||
const reversedCidr = merge(
|
||||
exclude(
|
||||
|
||||
Reference in New Issue
Block a user