Another attempt doing it my way
This commit is contained in:
parent
2727c82e02
commit
08c0af9974
19
src/main.rs
19
src/main.rs
@ -12,16 +12,13 @@ fn main() {
|
|||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
if output.status.success() {
|
let std_out = std::str::from_utf8(&output.stdout).unwrap();
|
||||||
let std_out = std::str::from_utf8(&output.stdout).unwrap();
|
print!("{}", std_out);
|
||||||
if std_out.len() > 0 {
|
let std_err = std::str::from_utf8(&output.stderr).unwrap();
|
||||||
print!("{}", std_out);
|
print!("{}", std_err);
|
||||||
}
|
|
||||||
let std_err = std::str::from_utf8(&output.stderr).unwrap();
|
match output.status.code() {
|
||||||
if std_err.len() > 0 {
|
Some(code) => std::process::exit(code),
|
||||||
print!("{}", std_err);
|
None => std::process::exit(1)
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::process::exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user