You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
use runas::Command;
|
|
|
|
use crate::mods::strs::{inf, err_unrec};
|
|
|
|
|
|
|
|
pub fn uninstall(noconfirm: bool, pkg: &str) {
|
|
|
|
inf(format!("Attempting to uninstall {}", pkg));
|
|
|
|
if noconfirm == true {
|
|
|
|
let result = Command::new("pacman").arg("-Rs").arg(&pkg).arg("--noconfirm").status();
|
|
|
|
match result {
|
|
|
|
Ok(_) => {
|
|
|
|
println!("")
|
|
|
|
}
|
|
|
|
Err(_) => {
|
|
|
|
err_unrec(format!("Couldn't uninstall {}", pkg))
|
|
|
|
}};
|
|
|
|
} else {
|
|
|
|
let result = Command::new("pacman").arg("-Rs").arg(&pkg).status();
|
|
|
|
match result {
|
|
|
|
Ok(_) => {
|
|
|
|
println!("")
|
|
|
|
}
|
|
|
|
Err(_) => {
|
|
|
|
err_unrec(format!("Couldn't uninstall {}", pkg))
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
}
|