Skip to content

Commit

Permalink
feat: make tag prefix configurable (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani authored and bcoe committed Nov 27, 2016
1 parent 5c543a1 commit 70b20c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions command.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ module.exports = require('yargs')
default: defaults.silent,
global: true
})
.option('tag-prefix', {
alias: 't',
describe: 'Set a custom prefix for the git tag to be created',
type: 'string',
default: defaults.tagPrefix,
global: true
})
.version()
.alias('version', 'v')
.help()
Expand Down
3 changes: 2 additions & 1 deletion defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"sign": false,
"noVerify": false,
"commitAll": false,
"silent": false
"silent": false,
"tagPrefix": "v"
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function tag (newVersion, pkgPrivate, argv, cb) {
tagOption = '-a '
}
checkpoint(argv, 'tagging release %s', [newVersion])
handledExec(argv, 'git tag ' + tagOption + 'v' + newVersion + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
handledExec(argv, 'git tag ' + tagOption + argv.tagPrefix + newVersion + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
var message = 'git push --follow-tags origin master'
if (pkgPrivate !== true) message += '; npm publish'

Expand Down

0 comments on commit 70b20c8

Please sign in to comment.