generated from pure_sagacity/rust-starter
added color + changed flake.nix a little
This commit is contained in:
@@ -10,3 +10,6 @@ devenv.local.yaml
|
||||
|
||||
# pre-commit
|
||||
.pre-commit-config.yaml
|
||||
|
||||
# Nix
|
||||
result
|
||||
|
||||
Generated
+10
@@ -486,6 +486,7 @@ name = "clonee"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"colored",
|
||||
"dialoguer",
|
||||
"keyring",
|
||||
"octocrab",
|
||||
@@ -510,6 +511,15 @@ version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
||||
|
||||
[[package]]
|
||||
name = "colored"
|
||||
version = "3.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.7"
|
||||
|
||||
@@ -12,3 +12,4 @@ serde_json = "1.0.150"
|
||||
octocrab = "0.54.0"
|
||||
dialoguer = "0.12"
|
||||
keyring = "4.1.4"
|
||||
colored = "3.1.1"
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
};
|
||||
|
||||
packages.${system}.default = naerskLib.buildPackage {
|
||||
src = "./.";
|
||||
name = "clonee";
|
||||
version = "1.0";
|
||||
src = ./.;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+10
-3
@@ -1,7 +1,10 @@
|
||||
use std::process;
|
||||
|
||||
use crate::{
|
||||
providers::{Provider, github::Github},
|
||||
tui::user_select_repo,
|
||||
};
|
||||
use colored::*;
|
||||
use dialoguer::{Select, theme::ColorfulTheme};
|
||||
mod providers;
|
||||
mod tui;
|
||||
@@ -32,9 +35,13 @@ async fn main() {
|
||||
|
||||
let repos = gh.repositories().await.expect("Failed to get repos.");
|
||||
|
||||
let selection = user_select_repo(repos)
|
||||
.await
|
||||
.expect("Failed to select repository.");
|
||||
let selection = match user_select_repo(repos).await {
|
||||
Ok(r) => r,
|
||||
Err(_) => {
|
||||
println!("{}", "No repository was selected!".red());
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
println!("{:#?}", selection);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user