Skip to content

Commit

Permalink
chore: fix ci (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored May 15, 2024
1 parent f7e9fd1 commit b963fd1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions services/update-components-notice.js
Original file line number Diff line number Diff line change
@@ -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/;
Expand Down Expand Up @@ -40,6 +39,6 @@ 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))
console.log('update components: ', result);
fs.writeFileSync(path.resolve(__dirname, './components-notice.json'), JSON.stringify(result, null, 2));
});

0 comments on commit b963fd1

Please sign in to comment.