Remove unneeded status check.

Since that we are using a .expect() method in the Command::New action, the next check is unneeded and undesirable because it just check the status of the command inside the chroot environment nad as result package executables return a non-success status when not arguments are given (as in our case).
This commit is contained in:
Eduard Tolosa 2019-05-12 23:41:15 -05:00
parent 9ffad185df
commit 7fc133fd5a

View file

@ -350,22 +350,22 @@ pub fn test_package(package: &str, executable: &str) {
&package
)
.unwrap();
let execute_package = Command::new("sudo")
Command::new("sudo")
.args(&[&devtools_nspawn, &chroot_blackarch, executable])
.status()
.expect(
"Failed to execute the {} binary in the chroot environment, check the binary name.",
);
if execute_package.success() {
writeln!(
coloring("green"),
"Binary {} sucessfully executed!",
executable
)
.unwrap();
} else {
writeln!(coloring("red"), "An error as ocurred while trying to execute the binary {}, are you sure that it's the binary name?", &executable).unwrap();
}
// if execute_package.success() {
// writeln!(
// coloring("green"),
// "Binary {} sucessfully executed!",
// executable
// )
// .unwrap();
// } else {
// writeln!(coloring("red"), "An error as ocurred while trying to execute the binary {}, are you sure that it's the binary name?", &executable).unwrap();
// }
} else {
writeln!(
coloring("red"),