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

warn newer available version of the x tool #104552

Merged
merged 16 commits into from
Jan 3, 2023
Merged
Prev Previous commit
Next Next commit
formatting
  • Loading branch information
DebugSteven committed Dec 31, 2022
commit 7fe2f73ecdde41ec3bc0bd9bfdee5cd064536d53
12 changes: 6 additions & 6 deletions src/tools/tidy/src/x_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ use std::io::ErrorKind;
use std::process::{Command, Stdio};

pub fn check(bad: &mut bool) {
let result = Command::new("x")
.arg("--version")
.stdout(Stdio::piped())
.spawn();
let result = Command::new("x").arg("--version").stdout(Stdio::piped()).spawn();
let child = match result {
Ok(child) => child,
Err(e) => match e.kind() {
ErrorKind::NotFound => return (),
ErrorKind::NotFound => return,
_ => return tidy_error!(bad, "{}", e),
},
};
Expand All @@ -28,7 +25,10 @@ pub fn check(bad: &mut bool) {
build: BuildMetadata::EMPTY,
};
if version < expected {
return tidy_error!(bad, "Current version of x is {version} Consider updating to the newer version of x by running `cargo install --path src/tools/x`");
return tidy_error!(
bad,
"Current version of x is {version} Consider updating to the newer version of x by running `cargo install --path src/tools/x`"
);
}
} else {
return tidy_error!(bad, "{}", output.status);
Expand Down