Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd "Check external command version for compatibility" #319
Conversation
bobbo
force-pushed the
bobbo:issue-286
branch
3 times, most recently
from
cdfda7e
to
9116c19
Oct 7, 2017
budziq
requested changes
Oct 7, 2017
src/app.md
Outdated
| let stdout = String::from_utf8(output.stdout)?; | ||
| // `git --version` output: "git version x.y.z" | ||
| let version = stdout.split(" ").last().expect("Invalid command output"); |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 7, 2017
Collaborator
lets avoid using expect here. you can add custom error message with ok_or_else(|| "Invalid command ...")?
src/app.md
Outdated
| let parsed_version = Version::parse(version)?; | ||
| if !version_test.matches(&parsed_version) { | ||
| bail!("Command version lower than minimum supported version") |
This comment has been minimized.
This comment has been minimized.
budziq
Oct 7, 2017
Collaborator
how about adding the parsed version number to the bail! invocation?
bail! has format capabilities identical to the println!
bobbo
force-pushed the
bobbo:issue-286
branch
from
9116c19
to
b4be175
Oct 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Hi @budziq, I've made the changes you suggested |
budziq
merged commit a4f355d
into
rust-lang-nursery:master
Oct 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Well done! Thanks @bobbo ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
bobbo commentedOct 7, 2017
•
edited by budziq
fixes #286