Skip to content

Commit

Permalink
build: 修复生成changelog的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
simply-none committed Apr 30, 2024
1 parent f597127 commit f16a062
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions utils/generateChangelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ for (let i = 0; i < commits.length; i++) {
let tag = commit.tag.split(',').find(name => {
return name.includes('tag:') || name.includes('HEAD')
})
console.log(commit.tag)
if (tag.includes('HEAD')) {
tag = generateVersion(pkg.version)
}
Expand Down Expand Up @@ -224,11 +223,11 @@ tagArr.forEach((tag, index) => {
let tagTitle = ''
let authorDate = curTagObj.info.authorDate.split(' ').slice(0, 1).join(' ')
if (tag === 'current') {
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/${commitObj[tagArr[index + 1]].info.abbrevHash}...${curTagObj.info.abbrevHash}) (${authorDate})\n\n`
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/v${commitObj[tagArr[index + 1]].info.abbrevHash}...v${curTagObj.info.abbrevHash}) (${authorDate})\n\n`
} else if (index === tagArr.length - 1) {
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/${firstCommit.abbrevHash}...${curTagObj.info.abbrevHash}) (${authorDate})\n\n`
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/v${firstCommit.abbrevHash}...v${curTagObj.info.abbrevHash}) (${authorDate})\n\n`
} else {
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/${commitObj[tagArr[index + 1]].info.tagNum}...${curTagObj.info.tagNum}) (${authorDate})\n\n`
tagTitle = `## [${curTagObj.info.tagNum}](${repo}/compare/v${commitObj[tagArr[index + 1]].info.tagNum}...v${curTagObj.info.tagNum}) (${authorDate})\n\n`

}

Expand Down

0 comments on commit f16a062

Please sign in to comment.