upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/sub_commands')
-rw-r--r--src/bin/ngit/sub_commands/init.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index 1d6d0e9..aa43106 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -215,7 +215,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
215 let mut maintainers_string = if !args.other_maintainers.is_empty() { 215 let mut maintainers_string = if !args.other_maintainers.is_empty() {
216 [args.other_maintainers.clone()].concat().join(" ") 216 [args.other_maintainers.clone()].concat().join(" ")
217 } else if repo_ref.is_none() && repo_config_result.is_err() { 217 } else if repo_ref.is_none() && repo_config_result.is_err() {
218 signer.public_key().await?.to_bech32()? 218 signer.get_public_key().await?.to_bech32()?
219 } else { 219 } else {
220 let maintainers = if let Ok(config) = &repo_config_result { 220 let maintainers = if let Ok(config) = &repo_config_result {
221 config.maintainers.clone() 221 config.maintainers.clone()
@@ -228,7 +228,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
228 .collect() 228 .collect()
229 } else { 229 } else {
230 //unreachable 230 //unreachable
231 vec![signer.public_key().await?.to_bech32()?] 231 vec![signer.get_public_key().await?.to_bech32()?]
232 }; 232 };
233 // add current user if not present 233 // add current user if not present
234 if maintainers.iter().any(|m| { 234 if maintainers.iter().any(|m| {
@@ -240,15 +240,18 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
240 }) { 240 }) {
241 maintainers.join(" ") 241 maintainers.join(" ")
242 } else { 242 } else {
243 [maintainers, vec![signer.public_key().await?.to_bech32()?]] 243 [
244 .concat() 244 maintainers,
245 .join(" ") 245 vec![signer.get_public_key().await?.to_bech32()?],
246 ]
247 .concat()
248 .join(" ")
246 } 249 }
247 }; 250 };
248 'outer: loop { 251 'outer: loop {
249 if !dont_ask 252 if !dont_ask
250 && signer 253 && signer
251 .public_key() 254 .get_public_key()
252 .await? 255 .await?
253 .to_bech32()? 256 .to_bech32()?
254 .eq(&maintainers_string) 257 .eq(&maintainers_string)
@@ -302,7 +305,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
302 } 305 }
303 // add current user incase removed 306 // add current user incase removed
304 if !maintainers.iter().any(|m| user_ref.public_key.eq(m)) { 307 if !maintainers.iter().any(|m| user_ref.public_key.eq(m)) {
305 maintainers.push(signer.public_key().await?); 308 maintainers.push(signer.get_public_key().await?);
306 } 309 }
307 break maintainers; 310 break maintainers;
308 } 311 }