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

feat: add semver_matches utility function #1713

Merged
merged 4 commits into from
Oct 27, 2023
Merged

feat: add semver_matches utility function #1713

merged 4 commits into from
Oct 27, 2023

Conversation

t3hmrman
Copy link
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
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
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.

src/function.rs Outdated Show resolved Hide resolved
src/function.rs Outdated Show resolved Hide resolved
src/function.rs Outdated Show resolved Hide resolved
src/function.rs Outdated Show resolved Hide resolved
tests/functions.rs Outdated Show resolved Hide resolved
src/function.rs Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@t3hmrman
Copy link
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 <[email protected]>
Co-authored-by: Casey Rodarmor <[email protected]>
@casey casey enabled auto-merge (squash) October 27, 2023 20:04
@casey casey merged commit 64d7d07 into casey:master Oct 27, 2023
5 checks passed
@casey
Copy link
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
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