Skip to content

Commit

Permalink
修复replace错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Jan 29, 2021
1 parent eae1e4b commit 604cf3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/cli-plugin-command-commit-lint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ export default function (api: IPluginAPI): void {
const huskyMsgPath = api.EnvManager.getEnv(HuskyGitParamsEnv)
const msgPath = gitMsgPath || huskyMsgPath
if (msgPath) {
const commitMsg = readFileSync(msgPath, 'utf-8')
.trim()
.replace(/# .*/, ' ')
const commitMsg = readFileSync(msgPath, 'utf-8').trim()
if (!commitRE.test(commitMsg) && !mergeRE.test(commitMsg)) {
console.info(`invalid commit message:
"${chalk.red(commitMsg)}".
"${chalk.red(commitMsg.replace(/# .*/, ' '))}".
Proper commit message format is required for automated changelog generation.
Expand Down

0 comments on commit 604cf3d

Please sign in to comment.