mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Chore: finish rewrite mitm hostname sgmodule script
This commit is contained in:
parent
cbb22f3b16
commit
d78e3a25ad
@ -1,5 +1,4 @@
|
|||||||
import { readFileByLine } from './lib/fetch-text-by-line';
|
import { readFileByLine } from './lib/fetch-text-by-line';
|
||||||
import fsPromises from 'fs/promises';
|
|
||||||
import pathFn from 'path';
|
import pathFn from 'path';
|
||||||
import table from 'table';
|
import table from 'table';
|
||||||
import listDir from '@sukka/listdir';
|
import listDir from '@sukka/listdir';
|
||||||
@ -42,7 +41,7 @@ const PRESET_MITM_HOSTNAMES = [
|
|||||||
let urlRegexPaths = [];
|
let urlRegexPaths = [];
|
||||||
|
|
||||||
urlRegexPaths.push(
|
urlRegexPaths.push(
|
||||||
...(await fsPromises.readFile(pathFn.join(__dirname, '../Modules/sukka_url_rewrite.sgmodule'), { encoding: 'utf-8' }))
|
...(await Bun.file(pathFn.join(__dirname, '../Modules/sukka_url_rewrite.sgmodule')).text())
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(
|
.filter(
|
||||||
i => !i.startsWith('#')
|
i => !i.startsWith('#')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user