diff --git a/command.js b/command.js index e6fcdd443..83242af41 100755 --- a/command.js +++ b/command.js @@ -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() diff --git a/defaults.json b/defaults.json index bb0c6f416..26ef43c73 100644 --- a/defaults.json +++ b/defaults.json @@ -5,5 +5,6 @@ "sign": false, "noVerify": false, "commitAll": false, - "silent": false + "silent": false, + "tagPrefix": "v" } diff --git a/index.js b/index.js index a619c9ccb..906d2e7b6 100755 --- a/index.js +++ b/index.js @@ -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'