mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 08:25:01 +01:00
require cargo check pass in testsuite
This commit is contained in:
parent
0ccd55fa0f
commit
a7881a426b
1 changed files with 15 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use anyhow::bail;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
if std::env::var("MINIMIZE_LINTS").as_deref() == Ok("1") {
|
||||
std::process::Command::new("cargo")
|
||||
|
|
@ -14,5 +16,17 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
let proj_dir = std::env::current_dir().expect("current dir not found");
|
||||
|
||||
testsuite::ensure_roots_kept(&proj_dir, roots)
|
||||
testsuite::ensure_roots_kept(&proj_dir, roots)?;
|
||||
|
||||
let check = std::process::Command::new("cargo")
|
||||
.arg("check")
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap();
|
||||
|
||||
if !check.success() {
|
||||
bail!("cargo check failed");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue