Skip to content

Commit

Permalink
fix: show correct pre-release tag in help output (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
spruce authored and bcoe committed Nov 1, 2018
1 parent fee872f commit d90154a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/lifecycles/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ function execTag (newVersion, pkgPrivate, args) {
.then(() => {
var message = 'git push --follow-tags origin master'
if (pkgPrivate !== true) message += ' && npm publish'
if (args.prerelease !== undefined) message += ' --tag prerelease'
if (args.prerelease !== undefined) {
if (args.prerelease === '') {
message += ' --tag prerelease'
} else {
message += ' --tag ' + args.prerelease
}
}

checkpoint(args, 'Run `%s` to publish', [message], chalk.blue(figures.info))
})
Expand Down
8 changes: 8 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,14 @@ describe('cli', function () {
commit('feat: first commit')
execCli('--prerelease').stdout.should.include('--tag prerelease')
})

it('advises use of --tag alpha for publishing to npm when tagging alpha', function () {
writePackageJson('1.0.0')
fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name="1.0.0">\n', 'utf-8')

commit('feat: first commit')
execCli('--prerelease alpha').stdout.should.include('--tag alpha')
})
})

describe('manual-release', function () {
Expand Down

0 comments on commit d90154a

Please sign in to comment.