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

Shorthand for syntax like '>= 6.1.0-0 <= 6.1.0'? #40

Closed
NickHeiner opened this issue Jul 11, 2013 · 5 comments
Closed

Shorthand for syntax like '>= 6.1.0-0 <= 6.1.0'? #40

NickHeiner opened this issue Jul 11, 2013 · 5 comments

Comments

@NickHeiner
Copy link

When I am working on a feature branch, I set the semver to be a pre-release of what version the code will be at when the branch is merged into master. (So if I'm starting at 6.0.0 and adding a feature, I set the semver to be 6.1.0-0 and increment the build tag as necessary.) When I point other dependents to use this branch to test it out, I want a semver that says 'use this version or any pre-releases thereof'. Would it be possible to get some shorthand for that case?

@isaacs
Copy link
Contributor

isaacs commented Jul 11, 2013

That's sort of what ~ does.

> semver.satisfies('1.2.3-asdf', '~1.2.3')
true

This also matches patch releases, though, I'm not sure if that works for your purposes:

> semver.satisfies('1.2.4', '~1.2.3')
true

@isaacs
Copy link
Contributor

isaacs commented Jul 12, 2013

If you really want this today, just do this: ~6.0.0 <6.0.1

@isaacs isaacs closed this as completed Jul 12, 2013
@NickHeiner
Copy link
Author

Yeah, I was hoping that ~1.2.1 would be equivalent to >= 1.2.1-0 <= 1.2.1, but it's not.

@isaacs
Copy link
Contributor

isaacs commented Jul 15, 2013

See #38, where the exact opposite assumption is made.

You cannot please everyone. ~ is a nice midway point, and works the same in node-semver as ~> does in rubygems. It's not changing now.

@NickHeiner
Copy link
Author

Yep, that makes sense.

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

No branches or pull requests

2 participants