Probably fix apt

This commit is contained in:
Beefki
2017-10-13 14:24:41 -05:00
parent 47c00435e6
commit 4da3895bbe
2 changed files with 62 additions and 40 deletions

View File

@ -37,24 +37,33 @@ fn main() {
let mut found: bool = false;
for prog in managers {
if found { break }
if found {
break;
}
if prog.exe.is_file() {
println!("Found {}, is this the manager you want to use? [Y/n]", prog.name);
if input().unwrap().trim().to_lowercase() == "n" {
continue
}else {
println!(
"Found {}, is this the manager you want to use? [Y/n]",
prog.name
);
if input().unwrap().trim().to_lowercase() == "n" {
continue;
} else {
found = true;
println!("Would you like to set {} as default? [y/N]", prog.name);
if input().unwrap().trim().to_lowercase() == "y" {
let check = prog.set_default();
match check {
Ok(_) => println!("Default set"),
Err(err) => println!("An error occured while setting default:\
{}", err)
Err(err) => {
println!(
"An error occured while setting default:\
{}",
err
)
}
}
}
//let mut child = call(prog, &config.action, &config.term.clone().unwrap_or_else(|| "".to_string()));
let mut child = config.run(prog);
child.wait().expect("Failed to wait on child");
}