From ebc7173c952064a8e38ccfb27476840586f0d3d2 Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 1 Mar 2025 08:45:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=BA=20mihomo=20=E9=85=8D=E7=BD=AE=E6=97=B6,=20=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E5=8F=AF=E4=BB=A5=E4=B8=BA=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- .../src/core/proxy-utils/processors/index.js | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/backend/package.json b/backend/package.json index 3bc83ef..edf32d6 100644 --- a/backend/package.json +++ b/backend/package.json @@ -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": { diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 8d98197..0312729 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -379,19 +379,22 @@ function ScriptOperator(script, targetPlatform, $arguments, source, $options) { throw new Error('patch is not an object'); output.$content = ProxyUtils.yaml.safeDump( deepMerge( - config || { - proxies: await produceArtifact({ - type: - output?.$file?.sourceType || - 'collection', - name: output?.$file?.sourceName, - platform: 'mihomo', - produceType: 'internal', - produceOpts: { - 'delete-underscore-fields': true, - }, - }), - }, + config || + (output?.$file?.sourceType === 'none' + ? {} + : { + proxies: await produceArtifact({ + type: + output?.$file?.sourceType || + 'collection', + name: output?.$file?.sourceName, + platform: 'mihomo', + produceType: 'internal', + produceOpts: { + '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}