Skip to content

feat: add semver_matches utility function#1713

Merged
casey merged 4 commits intocasey:masterfrom
t3hmrman:feat/add-semver-match-utility
Oct 27, 2023
Merged

feat: add semver_matches utility function#1713
casey merged 4 commits intocasey:masterfrom
t3hmrman:feat/add-semver-match-utility

Conversation

@t3hmrman
Copy link
Copy Markdown
Contributor

While coordinating different programs using just, it's often necessary to compare the versions of different binaries or utilitiies. Assuming that the utility in question providers a --version switch and can reasonably print out a version, being able to match semver of the utility to an expectation is very useful.

This commit adds a semver_matches utility which utilizes the semver crate (https://crates.io/crates/semver) to provide matching functionality to Justfiles.

Resolves #1712

@t3hmrman
Copy link
Copy Markdown
Contributor Author

Hey @casey got some code up to implement the new utility -- please let me know if I'm missing anything, or if you'd like more test cases!

Copy link
Copy Markdown
Owner

@casey casey left a comment

Choose a reason for hiding this comment

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

Looks good! Check out the review comments.

Comment thread src/function.rs Outdated
Comment thread src/function.rs Outdated
Comment thread src/function.rs Outdated
Comment thread src/function.rs Outdated
Comment thread tests/functions.rs Outdated
Comment thread src/function.rs Outdated
Comment thread README.md Outdated
@t3hmrman
Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review @casey , I made the changes and squashed to get one commit (I'm a fan of single non-merge commit history).

t3hmrman and others added 4 commits October 27, 2023 17:59
While coordinating different programs using `just`, it's often
necessary to compare the *versions* of different binaries or
utilitiies. Assuming that the utility in question providers a
`--version` switch and can reasonably print out a version, being able
to match semver of the utility to an expectation is very useful.

This commit adds a `semver_matches` utility which utilizes the
`semver` crate (https://crates.io/crates/semver) to provide matching
functionality to `Justfile`s.

Signed-off-by: vados <vados@vadosware.io>
Co-authored-by: Casey Rodarmor <casey@rodarmor.com>
@casey casey enabled auto-merge (squash) October 27, 2023 20:04
@casey casey merged commit 64d7d07 into casey:master Oct 27, 2023
@casey
Copy link
Copy Markdown
Owner

casey commented Oct 27, 2023

Nice, merged! Thank you for the PR!

@t3hmrman t3hmrman deleted the feat/add-semver-match-utility branch October 28, 2023 02:20
@t3hmrman
Copy link
Copy Markdown
Contributor Author

Thanks for the help and thorough reviews! :)

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.

Add semver_lt/semver_gt/semver_eq/... functions

2 participants