Skip to content

Commit d90154a

Browse files
sprucebcoe
authored andcommittedNov 1, 2018
fix: show correct pre-release tag in help output (#259)
1 parent fee872f commit d90154a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

‎lib/lifecycles/tag.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ function execTag (newVersion, pkgPrivate, args) {
2828
.then(() => {
2929
var message = 'git push --follow-tags origin master'
3030
if (pkgPrivate !== true) message += ' && npm publish'
31-
if (args.prerelease !== undefined) message += ' --tag prerelease'
31+
if (args.prerelease !== undefined) {
32+
if (args.prerelease === '') {
33+
message += ' --tag prerelease'
34+
} else {
35+
message += ' --tag ' + args.prerelease
36+
}
37+
}
3238

3339
checkpoint(args, 'Run `%s` to publish', [message], chalk.blue(figures.info))
3440
})

‎test.js

+8
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,14 @@ describe('cli', function () {
423423
commit('feat: first commit')
424424
execCli('--prerelease').stdout.should.include('--tag prerelease')
425425
})
426+
427+
it('advises use of --tag alpha for publishing to npm when tagging alpha', function () {
428+
writePackageJson('1.0.0')
429+
fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name="1.0.0">\n', 'utf-8')
430+
431+
commit('feat: first commit')
432+
execCli('--prerelease alpha').stdout.should.include('--tag alpha')
433+
})
426434
})
427435

428436
describe('manual-release', function () {

0 commit comments

Comments
 (0)
Please sign in to comment.