mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: build infra changes
This commit is contained in:
@@ -22,11 +22,11 @@ const RESERVED_IPV4_CIDR = [
|
||||
'240.0.0.0/4'
|
||||
];
|
||||
|
||||
export const buildInternalReverseChnCIDR = task(__filename, async () => {
|
||||
export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
|
||||
const [{ exclude }, cidr] = await Promise.all([
|
||||
import('cidr-tools-wasm'),
|
||||
processLineFromReadline(await fetchRemoteTextAndCreateReadlineInterface('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt')),
|
||||
fsp.mkdir(path.resolve(__dirname, '../List/internal'), { recursive: true })
|
||||
fsp.mkdir(path.resolve(import.meta.dir, '../List/internal'), { recursive: true })
|
||||
]);
|
||||
|
||||
const reversedCidr = exclude(
|
||||
@@ -40,7 +40,7 @@ export const buildInternalReverseChnCIDR = task(__filename, async () => {
|
||||
true
|
||||
);
|
||||
|
||||
return Bun.write(path.resolve(__dirname, '../List/internal/reversed-chn-cidr.txt'), `${reversedCidr.join('\n')}\n`);
|
||||
return Bun.write(path.resolve(import.meta.dir, '../List/internal/reversed-chn-cidr.txt'), `${reversedCidr.join('\n')}\n`);
|
||||
});
|
||||
|
||||
if (import.meta.main) {
|
||||
|
||||
Reference in New Issue
Block a user