mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix(release): changelog script
This commit is contained in:
parent
5cfca8e954
commit
bf82c79c22
@ -59,8 +59,13 @@ async function getPackageJson(pkg, pkgType) {
|
|||||||
} else {
|
} else {
|
||||||
dir = `pro-plugins/@nocobase/${pkg}`;
|
dir = `pro-plugins/@nocobase/${pkg}`;
|
||||||
}
|
}
|
||||||
const pkgJSON = await fs.readFile(path.join(__dirname, '../../packages', dir, 'package.json'), 'utf8');
|
try {
|
||||||
return JSON.parse(pkgJSON);
|
const pkgJSON = await fs.readFile(path.join(__dirname, '../../packages', dir, 'package.json'), 'utf8');
|
||||||
|
return JSON.parse(pkgJSON);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Get package.json for ${pkg} failed, error: ${error.message}`);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function parsePackage(files, pkgType, pkg) {
|
async function parsePackage(files, pkgType, pkg) {
|
||||||
@ -114,7 +119,7 @@ async function parsePR(number, pkgType, cwd, pkg, retries = 10) {
|
|||||||
const { description, docTitle, docLink } = parsePRBody(body, 'English');
|
const { description, docTitle, docLink } = parsePRBody(body, 'English');
|
||||||
const { description: cnDescription, docTitle: cnDocTitle, docLink: cnDocLink } = parsePRBody(body, 'Chinese');
|
const { description: cnDescription, docTitle: cnDocTitle, docLink: cnDocLink } = parsePRBody(body, 'Chinese');
|
||||||
const { displayName, cnDisplayName, name } = await parsePackage(files, pkgType, pkg);
|
const { displayName, cnDisplayName, name } = await parsePackage(files, pkgType, pkg);
|
||||||
const pkgName = name.split('/').pop();
|
const pkgName = name?.split('/').pop();
|
||||||
const changelog = {
|
const changelog = {
|
||||||
prType,
|
prType,
|
||||||
number,
|
number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user