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.
amethyst/src/mods/uninstall.rs

12 lines
408 B
Rust

use runas::Command;
3 years ago
pub fn uninstall(noconfirm: bool, pkg: &str) {
let errstr = format!("Could not remove package {}", pkg); //again, we should choose one way to do error messages
if noconfirm == false {
Command::new("pacman").arg("-R").arg(&pkg).status().expect(&errstr);
} else {
Command::new("pacman").arg("-R").arg("--noconfirm").arg(&pkg).status().expect(&errstr);
}
}