Skip to content

Commit

Permalink
feat(@142vip/release-version): 优化CHANGELOG文档存储目录,基于cwd参数生成目录绝对路径 (#…
Browse files Browse the repository at this point in the history
…63)

Co-authored-by: chufan <mmdapl@163.com>
  • Loading branch information
微信公众号:储凡 and mmdapl authored Aug 22, 2024
1 parent 05439f0 commit dede731
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/release-version/src/core/version-bump.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import process from 'node:process'
import path from 'node:path'
import symbols from 'log-symbols'
import prompts from 'prompts'
import { bold, cyan, green } from 'kolorist'
Expand Down Expand Up @@ -48,7 +49,8 @@ export async function versionBump(arg: (VersionBumpOptions) | string = {}): Prom
if (operation.options.changelog) {
console.log(symbols.info, 'Generate CHANGELOG.md By @142vip/changelog', operation.options.execute)
try {
const baseCommand = `changelog --output CHANGELOG.md --name v${operation.state.newVersion}`
const filePath = path.join(operation.options.cwd, 'CHANGELOG.md')
const baseCommand = `changelog --output "${filePath}" --name v${operation.state.newVersion}`
// 支持monorepo子模块
await execShell(operation.options.scopeName != null
? { command: `${baseCommand} --scopeName ${operation.options.scopeName}`, description: `MonoRepo模式,生成${operation.options.scopeName}模块的CHANGELOG文档` }
Expand Down

0 comments on commit dede731

Please sign in to comment.