Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing named prerelease advises to push same tag-name #259

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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