Skip to content

Commit ebc7173

Browse files
committed
feat: 文件类型为 mihomo 配置时, 来源可以为无
1 parent dd4e0ce commit ebc7173

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.16.61",
3+
"version": "2.16.62",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/processors/index.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,22 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
379379
throw new Error('patch is not an object');
380380
output.$content = ProxyUtils.yaml.safeDump(
381381
deepMerge(
382-
config || {
383-
proxies: await produceArtifact({
384-
type:
385-
output?.$file?.sourceType ||
386-
'collection',
387-
name: output?.$file?.sourceName,
388-
platform: 'mihomo',
389-
produceType: 'internal',
390-
produceOpts: {
391-
'delete-underscore-fields': true,
392-
},
393-
}),
394-
},
382+
config ||
383+
(output?.$file?.sourceType === 'none'
384+
? {}
385+
: {
386+
proxies: await produceArtifact({
387+
type:
388+
output?.$file?.sourceType ||
389+
'collection',
390+
name: output?.$file?.sourceName,
391+
platform: 'mihomo',
392+
produceType: 'internal',
393+
produceOpts: {
394+
'delete-underscore-fields': true,
395+
},
396+
}),
397+
}),
395398
patch,
396399
),
397400
);
@@ -430,7 +433,7 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
430433
console.log(e.message ?? e);
431434
}
432435
}
433-
$content = ProxyUtils.yaml.safeDump(await main(config || {
436+
$content = ProxyUtils.yaml.safeDump(await main(config || ($file.sourceType === 'none' ? {} : {
434437
proxies: await produceArtifact({
435438
type: $file.sourceType || 'collection',
436439
name: $file.sourceName,
@@ -440,7 +443,7 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) {
440443
'delete-underscore-fields': true
441444
}
442445
}),
443-
}))
446+
})))
444447
}
445448
} else {
446449
${script}

0 commit comments

Comments
 (0)