From c019196a8af6358cf50598dcb779fa310eb7b350 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Wed, 15 May 2024 16:01:31 +0800 Subject: [PATCH] chore: fix ci --- services/update-components-notice.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/update-components-notice.js b/services/update-components-notice.js index b026635f..a11c72cc 100644 --- a/services/update-components-notice.js +++ b/services/update-components-notice.js @@ -1,15 +1,14 @@ const fs = require('fs'); const path = require('path'); -const RELEASE_API = - 'https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/github-contributors/release'; +const RELEASE_API = 'https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/github-contributors/release'; const DEFAULT_RESPONSE = { vue: [], 'vue-next': [], react: [], miniprogram: [] }; function getFeatures(release) { const result = DEFAULT_RESPONSE; const frameworkReg = /##\s([\s\S]+?)详情见/g; - const frameworks = release.match(frameworkReg); + const frameworks = release.match(frameworkReg) || []; frameworks.forEach((item) => { // 获取框架标题 const titleReg = /## (\w+) for/; @@ -40,6 +39,5 @@ fetch(RELEASE_API) .then((res) => { const latestRelease = res[0].body; const result = getFeatures(latestRelease); - console.log('update components: ', result) - fs.writeFileSync(path.resolve(__dirname, './components-notice.json'), JSON.stringify(result, null, 2)) + fs.writeFileSync(path.resolve(__dirname, './components-notice.json'), JSON.stringify(result, null, 2)); });