Skip to content

Conversation

chtimi59
Copy link

From my own needs...

Maybe an idea form improvement ?

I actually realize that semver_satisfies didn't support those kind of situation (with no "operation"):

  • "1.2.3" should statisfy "1.2.x"
  • "1.2.3" should statisfy "1.2"

To achieved that, I also add a little helper "semver_parse_op" to retrieve "operation" from a string

Example

semver_t semver = {};
char op[3];
semver_parse_op(">=1.2.x", &semver, &op)

/*
returns

 op: ">="

 semver: {
   major = 1
   minor = 2
   patch = 0
   is_major_set = 1
   is_minor_set = 1
   is_patch_set = 0
}
*/

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.

1 participant