Feat: implement Clash Meta mrs format

This commit is contained in:
SukkaW
2024-08-06 19:10:29 +08:00
parent 03f1a0058e
commit 50ca0c5e9e
9 changed files with 114 additions and 10 deletions

View File

@@ -127,6 +127,8 @@ function transformDomainset(parentSpan: Span, sourcePath: string, relativePath:
description = SHARED_DESCRIPTION;
}
const clashFileBasename = relativePath.slice(0, -path.extname(relativePath).length);
return createRuleset(
span,
title,
@@ -135,7 +137,7 @@ function transformDomainset(parentSpan: Span, sourcePath: string, relativePath:
deduped,
'domainset',
path.resolve(outputSurgeDir, relativePath),
path.resolve(outputClashDir, `${relativePath.slice(0, -path.extname(relativePath).length)}.txt`)
path.resolve(outputClashDir, `${clashFileBasename}.txt`)
);
}
);