upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands/init.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-11-28 07:47:08 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-11-28 07:47:08 +0000
commitd1488fad3a89ef026c968c30766144a56528f11d (patch)
tree1fd7d12de5a0eb0df1ef86a76860b788c573c7a7 /src/bin/ngit/sub_commands/init.rs
parent7e2f354d6fb07b1a9f1bb7bc50287972deec2b83 (diff)
feat(init): reorder web input
so relays come straight after git server because they both require choices with some sort of mental burden
Diffstat (limited to 'src/bin/ngit/sub_commands/init.rs')
-rw-r--r--src/bin/ngit/sub_commands/init.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index 0d3e344..1b9ba5e 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -302,25 +302,6 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
302 args.clone_url.clone() 302 args.clone_url.clone()
303 }; 303 };
304 304
305 let web: Vec<String> = if args.web.is_empty() {
306 Interactor::default()
307 .input(
308 PromptInputParms::default()
309 .with_prompt("repo website")
310 .optional()
311 .with_default(if let Some(repo_ref) = &repo_ref {
312 repo_ref.web.clone().join(" ")
313 } else {
314 format!("https://gitworkshop.dev/repo/{}", &identifier)
315 }),
316 )?
317 .split(' ')
318 .map(std::string::ToString::to_string)
319 .collect()
320 } else {
321 args.web.clone()
322 };
323
324 // TODO: check if relays are free to post to so contributors can submit patches 305 // TODO: check if relays are free to post to so contributors can submit patches
325 // TODO: recommend some reliable free ones 306 // TODO: recommend some reliable free ones
326 let relays: Vec<RelayUrl> = { 307 let relays: Vec<RelayUrl> = {
@@ -364,6 +345,25 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
364 } 345 }
365 }; 346 };
366 347
348 let web: Vec<String> = if args.web.is_empty() {
349 Interactor::default()
350 .input(
351 PromptInputParms::default()
352 .with_prompt("repo website")
353 .optional()
354 .with_default(if let Some(repo_ref) = &repo_ref {
355 repo_ref.web.clone().join(" ")
356 } else {
357 format!("https://gitworkshop.dev/repo/{}", &identifier)
358 }),
359 )?
360 .split(' ')
361 .map(std::string::ToString::to_string)
362 .collect()
363 } else {
364 args.web.clone()
365 };
366
367 let earliest_unique_commit = match &args.earliest_unique_commit { 367 let earliest_unique_commit = match &args.earliest_unique_commit {
368 Some(t) => t.clone(), 368 Some(t) => t.clone(),
369 None => { 369 None => {