-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn when there's a newer version of the x tool available
- Loading branch information
1 parent
726bbfc
commit c495558
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,3 +69,4 @@ pub mod ui_tests; | |
pub mod unit_tests; | ||
pub mod unstable_book; | ||
pub mod walk; | ||
pub mod x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::process::Command; | ||
|
||
pub fn check(_bad: &mut bool) { | ||
let result = Command::new("x") | ||
.arg("--version") | ||
.output(); | ||
let output = match result { | ||
Ok(output) => output, | ||
Err(_e) => todo!(), | ||
}; | ||
|
||
if output.status.success() { | ||
let version = String::from_utf8_lossy(&output.stdout); | ||
assert_eq!("0.1.0", version.trim_end()); | ||
} | ||
// FIXME: throw some kind of tidy error when the version of x isn't | ||
// greater than or equal to the version we'd expect. | ||
//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`") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters