upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/ngit/sub_commands/init.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index 01fcaea..6f3a357 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -266,11 +266,23 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
266 ); 266 );
267 let mut selections: Vec<bool> = vec![true; options.len()]; // Initialize selections based on existing options 267 let mut selections: Vec<bool> = vec![true; options.len()]; // Initialize selections based on existing options
268 let empty = options.is_empty(); 268 let empty = options.is_empty();
269 for user_grasp_option in user_ref.grasp_list.urls {
270 // Check if any option contains the user_grasp_option as a substring
271 if !options
272 .iter()
273 .any(|option| option.contains(user_grasp_option.as_str()))
274 {
275 options.push(user_grasp_option.to_string()); // Add if not found
276 selections.push(empty); // mark as selected if no existing grasp otherwise not
277 }
278 }
279
280 let empty = options.is_empty();
269 for fallback in fallback_grasp_servers { 281 for fallback in fallback_grasp_servers {
270 // Check if any option contains the fallback as a substring 282 // Check if any option contains the fallback as a substring
271 if !options.iter().any(|option| option.contains(fallback)) { 283 if !options.iter().any(|option| option.contains(fallback)) {
272 options.push(fallback.clone()); // Add fallback if not found 284 options.push(fallback.clone()); // Add fallback if not found
273 selections.push(empty); // mark as selected if no existing ngit relay otherwise not 285 selections.push(empty); // mark as selected if no existing selections otherwise not
274 } 286 }
275 } 287 }
276 let selected = multi_select_with_custom_value( 288 let selected = multi_select_with_custom_value(