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

Add --tag option #46

Merged
merged 2 commits into from
Jul 7, 2016
Merged

Add --tag option #46

merged 2 commits into from
Jul 7, 2016

Conversation

developit
Copy link
Contributor

Publish Add support for --tag xx, which publishes under a given dist-tag. Closes #45.


Examples
$ np
$ np patch
$ np 1.0.2
$ np 1.0.2-beta.3 --tag beta
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use --tag=beta

Copy link
Contributor Author

@developit developit Jul 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ (I haven't had a chance to use meow yet, been meaning to switch from yargs)

@developit
Copy link
Contributor Author

Hoping you merge this - I believe it np would then be able to replace my current process:

npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish

@SamVerschueren
Copy link
Collaborator

Instead of using an extra flag, can't we just extract the tag out of the version with semver?

const semver = require('semver');

semver.prerelease('1.0.2-beta.3');
//=> ['beta', 3]

@developit
Copy link
Contributor Author

@SamVerschueren That would be pretty sweet and make a good default. Still nice to be able to override it manually for other use-cases (--tag=legacy etc).

@sindresorhus sindresorhus merged commit 1925dd1 into sindresorhus:master Jul 7, 2016
@sindresorhus
Copy link
Owner

Thanks @developit :)

@sindresorhus
Copy link
Owner

@SamVerschueren Cool idea, but I rarely use prereleases myself and that behavior would be surprising to many, although better.

@SamVerschueren
Copy link
Collaborator

I never used them to be honest, it was just an idea :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants