-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.rs
29 lines (27 loc) · 851 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use std::path::PathBuf;
use anyhow::Result;
use run_script::ScriptOptions;
fn main() -> Result<()> {
let mut options = ScriptOptions::new();
options.working_directory = Some(PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?));
let args = vec![];
let (code, output, error) = run_script::run(
r#"
WORKSPACE_MANIFEST=$(cargo locate-project --workspace | jq -r '.root')
WORKSPACE_DIR=$(dirname ${WORKSPACE_MANIFEST})
cd ${WORKSPACE_DIR}
cargo deny check
"#,
&args,
&options,
)
.unwrap();
if code != 0 {
eprintln!("==== STDOUT: cargo deny check ");
eprintln!("{0}", output);
eprintln!("==== STDERR: cargo deny check ");
eprintln!("{0}", error);
panic!("`cargo deny check` failed code={0}", code);
}
Ok(())
}