added the provider trait, github provider, and a fzf selector.

i forgot to commit :(
This commit is contained in:
2026-07-10 18:53:36 -05:00
parent b476cd1e85
commit 0e2155c1b3
6 changed files with 3818 additions and 3 deletions
+41 -2
View File
@@ -1,3 +1,42 @@
fn main() {
println!("Hello, world!");
use crate::{
providers::{Provider, github::Github},
tui::user_select_repo,
};
use dialoguer::{Select, theme::ColorfulTheme};
mod providers;
mod tui;
pub fn ask_yes_no(message: &str) -> bool {
let options = vec!["Yes", "No"];
let selection = Select::with_theme(&ColorfulTheme::default())
.with_prompt(message.to_string())
.items(&options)
.default(0)
.interact()
.unwrap();
match options[selection] {
"Yes" => true,
"No" => false,
_ => unreachable!(),
}
}
#[tokio::main]
async fn main() {
// Testing to see if github provider works.
let gh = Github {
username: "pure-sagacity".to_string(),
};
let repos = gh.repositories().await.expect("Failed to get repos.");
let selection = user_select_repo(repos)
.await
.expect("Failed to select repository.");
println!("{:#?}", selection);
println!("{}", ask_yes_no("Clone the repo?"));
}