Probably fix apt
This commit is contained in:
25
src/main.rs
25
src/main.rs
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user