Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.

Commit 097d04d

Browse files
committed
fix: uses existing version for commit and tag messages in release
1 parent 560ec41 commit 097d04d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bin/commit.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ export async function commit(config) {
1717
const { precommit, postcommit, pretag, posttag, prepush, postpush } =
1818
config.hooks
1919
const VERSION_INSERT = "${version}"
20+
const tagVersion = config.releaseVersion || getCurrentVersion(config)
2021

2122
if (shouldCommit) {
2223
const commitMsg =
2324
commitMessage.indexOf(VERSION_INSERT) > -1
24-
? commitMessage.replace(VERSION_INSERT, config.releaseVersion)
25+
? commitMessage.replace(VERSION_INSERT, tagVersion)
2526
: commitMessage
2627
const commitCmd = `git commit -m '${commitMsg}'`
2728

@@ -41,11 +42,9 @@ export async function commit(config) {
4142
if (shouldTag) {
4243
const tagMsg =
4344
tagMessage.indexOf(VERSION_INSERT) > -1
44-
? tagMessage.replace(VERSION_INSERT, config.releaseVersion)
45+
? tagMessage.replace(VERSION_INSERT, tagVersion)
4546
: tagMessage
46-
const tagCmd = `git tag -a -m '${tagMsg}' ${
47-
config.releaseVersion || getCurrentVersion(config)
48-
}`
47+
const tagCmd = `git tag -a -m '${tagMsg}' ${tagVersion}`
4948

5049
if (pretag) {
5150
await triggerCmd({ config, cmd: pretag, step: "Pretag" })

0 commit comments

Comments
 (0)