From ed3f491c982c9e5ba33601a549d3dafa991b3aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 15 Nov 2024 16:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-and-upload.yml | 1 + packages/core/src/modules/plugin/node/config.js | 2 +- packages/core/src/modules/plugin/node/index.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-and-upload.yml b/.github/workflows/test-and-upload.yml index 40e77af..d05e749 100644 --- a/.github/workflows/test-and-upload.yml +++ b/.github/workflows/test-and-upload.yml @@ -5,6 +5,7 @@ on: branches: - master - release + - '1.x' pull_request: branches: - master diff --git a/packages/core/src/modules/plugin/node/config.js b/packages/core/src/modules/plugin/node/config.js index cc30647..f9697a1 100644 --- a/packages/core/src/modules/plugin/node/config.js +++ b/packages/core/src/modules/plugin/node/config.js @@ -11,7 +11,7 @@ module.exports = { 'cafile': false, 'NODE_EXTRA_CA_CERTS': false, 'NODE_TLS_REJECT_UNAUTHORIZED': false, - 'yarnRegistry': 'null', + 'yarnRegistry': 'default', 'registry': 'https://registry.npmjs.org', // 可以选择切换官方或者淘宝镜像 }, // intercepts: { diff --git a/packages/core/src/modules/plugin/node/index.js b/packages/core/src/modules/plugin/node/index.js index d26adc1..e192695 100644 --- a/packages/core/src/modules/plugin/node/index.js +++ b/packages/core/src/modules/plugin/node/index.js @@ -45,7 +45,7 @@ const NodePlugin = function (context) { const cmds = [] for (const item of list) { - if (item.value != null && item.value.length > 0 && item.value !== 'default') { + if (item.value != null && item.value.length > 0 && item.value !== 'default' && item.value !== 'null') { cmds.push(`${command} config set ${item.key} ${item.value}`) } else { cmds.push(`${command} config delete ${item.key}`) @@ -68,7 +68,7 @@ const NodePlugin = function (context) { const cmds = [] log.debug('yarn set:', JSON.stringify(list)) for (const item of list) { - if (item.value != null && item.value.length > 0 && item.value !== 'default') { + if (item.value != null && item.value.length > 0 && item.value !== 'default' && item.value !== 'null') { cmds.push(`yarn config set ${item.key} ${item.value}`) } else { cmds.push(`yarn config delete ${item.key}`)