feat: 文件类型为 mihomo 配置时, 来源可以为无

This commit is contained in:
xream 2025-03-01 08:45:17 +08:00
parent dd4e0cef68
commit ebc7173c95
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.16.61",
"version": "2.16.62",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@ -379,7 +379,10 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
throw new Error('patch is not an object');
output.$content = ProxyUtils.yaml.safeDump(
deepMerge(
config || {
config ||
(output?.$file?.sourceType === 'none'
? {}
: {
proxies: await produceArtifact({
type:
output?.$file?.sourceType ||
@ -391,7 +394,7 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
'delete-underscore-fields': true,
},
}),
},
}),
patch,
),
);
@ -430,7 +433,7 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
console.log(e.message ?? e);
}
}
$content = ProxyUtils.yaml.safeDump(await main(config || {
$content = ProxyUtils.yaml.safeDump(await main(config || ($file.sourceType === 'none' ? {} : {
proxies: await produceArtifact({
type: $file.sourceType || 'collection',
name: $file.sourceName,
@ -440,7 +443,7 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
'delete-underscore-fields': true
}
}),
}))
})))
}
} else {
${script}