mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: create rule set / Add China IP sing-box
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { dirname } from 'path';
|
||||
import path, { dirname } from 'path';
|
||||
import fs from 'fs';
|
||||
import fsp from 'fs/promises';
|
||||
import { makeRe } from 'picomatch';
|
||||
@@ -33,3 +33,15 @@ export const writeFile: Write = async (destination: string, input, dir = dirname
|
||||
export const domainWildCardToRegex = (domain: string) => {
|
||||
return makeRe(domain, { contains: false, strictSlashes: true }).source;
|
||||
};
|
||||
|
||||
const OUTPUT_SURGE_DIR = path.resolve(__dirname, '../../List');
|
||||
const OUTPUT_CLASH_DIR = path.resolve(__dirname, '../../Clash');
|
||||
const OUTPUT_SINGBOX_DIR = path.resolve(__dirname, '../../sing-box');
|
||||
|
||||
export const output = (id: string, type: 'non_ip' | 'ip' | 'domainset') => {
|
||||
return [
|
||||
path.join(OUTPUT_SURGE_DIR, type, id + '.conf'),
|
||||
path.join(OUTPUT_CLASH_DIR, type, id + '.txt'),
|
||||
path.join(OUTPUT_SINGBOX_DIR, type, id + '.json')
|
||||
] as const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user