更新依赖

This commit is contained in:
lyswhut
2022-04-26 13:04:19 +08:00
parent 9393906eb9
commit c9cf30692f
3 changed files with 657 additions and 478 deletions
+9 -9
View File
@@ -9,12 +9,12 @@ const version_bak = JSON.stringify(version, null, 2)
const parseChangelog = require('changelog-parser')
const changelogPath = jp('../../CHANGELOG.md')
const md_renderer = markdownStr => new (require('markdown-it'))({
html: true,
linkify: true,
typographer: true,
breaks: true,
}).render(markdownStr)
// const md_renderer = markdownStr => new (require('markdown-it'))({
// html: true,
// linkify: true,
// typographer: true,
// breaks: true,
// }).render(markdownStr)
const getPrevVer = () => parseChangelog(changelogPath).then(res => {
if (!res.versions.length) throw new Error('CHANGELOG 无法解析到版本号')
@@ -28,7 +28,7 @@ const updateChangeLog = async(newVerNum, newChangeLog) => {
fs.writeFileSync(changelogPath, changeLog.replace(new RegExp('(## [?0.1.1]?)'), log + '\n$1'), 'utf-8')
}
const renderChangeLog = md => md_renderer(md)
// const renderChangeLog = md => md_renderer(md)
module.exports = async newVerNum => {
@@ -38,7 +38,7 @@ module.exports = async newVerNum => {
newVerNum = verArr.join('.')
}
const newMDChangeLog = fs.readFileSync(jp('../changeLog.md'), 'utf-8')
const newChangeLog = renderChangeLog(newMDChangeLog)
// const newChangeLog = renderChangeLog(newMDChangeLog)
version.history.unshift({
version: version.version,
desc: version.desc,
@@ -58,7 +58,7 @@ module.exports = async newVerNum => {
return {
pkg_bak,
version_bak,
changeLog: newChangeLog,
// changeLog: newChangeLog,
}
}