Skip to content

Commit 70b20c8

Browse files
niieanibcoe
authored andcommitted
feat: make tag prefix configurable (#143)
1 parent 5c543a1 commit 70b20c8

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

command.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ module.exports = require('yargs')
6363
default: defaults.silent,
6464
global: true
6565
})
66+
.option('tag-prefix', {
67+
alias: 't',
68+
describe: 'Set a custom prefix for the git tag to be created',
69+
type: 'string',
70+
default: defaults.tagPrefix,
71+
global: true
72+
})
6673
.version()
6774
.alias('version', 'v')
6875
.help()

defaults.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"sign": false,
66
"noVerify": false,
77
"commitAll": false,
8-
"silent": false
8+
"silent": false,
9+
"tagPrefix": "v"
910
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function tag (newVersion, pkgPrivate, argv, cb) {
203203
tagOption = '-a '
204204
}
205205
checkpoint(argv, 'tagging release %s', [newVersion])
206-
handledExec(argv, 'git tag ' + tagOption + 'v' + newVersion + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
206+
handledExec(argv, 'git tag ' + tagOption + argv.tagPrefix + newVersion + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
207207
var message = 'git push --follow-tags origin master'
208208
if (pkgPrivate !== true) message += '; npm publish'
209209

0 commit comments

Comments
 (0)