diff options
Diffstat (limited to 'src/bin/git_remote_nostr/main.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/main.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bin/git_remote_nostr/main.rs b/src/bin/git_remote_nostr/main.rs index b26981d..3663d5b 100644 --- a/src/bin/git_remote_nostr/main.rs +++ b/src/bin/git_remote_nostr/main.rs | |||
| @@ -12,7 +12,7 @@ use std::{ | |||
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | use anyhow::{Context, Result, bail}; | 14 | use anyhow::{Context, Result, bail}; |
| 15 | use client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache}; | 15 | use client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache, is_verbose}; |
| 16 | use git::{RepoActions, nostr_url::NostrUrlDecoded}; | 16 | use git::{RepoActions, nostr_url::NostrUrlDecoded}; |
| 17 | use ngit::{ | 17 | use ngit::{ |
| 18 | client::{self, Params}, | 18 | client::{self, Params}, |
| @@ -156,7 +156,10 @@ async fn fetching_with_report_for_helper( | |||
| 156 | trusted_maintainer_coordinate: &Nip19Coordinate, | 156 | trusted_maintainer_coordinate: &Nip19Coordinate, |
| 157 | ) -> Result<()> { | 157 | ) -> Result<()> { |
| 158 | let term = console::Term::stderr(); | 158 | let term = console::Term::stderr(); |
| 159 | term.write_line("nostr: fetching...")?; | 159 | let verbose = is_verbose(); |
| 160 | if verbose { | ||
| 161 | term.write_line("nostr: fetching...")?; | ||
| 162 | } | ||
| 160 | let (relay_reports, progress_reporter) = client | 163 | let (relay_reports, progress_reporter) = client |
| 161 | .fetch_all( | 164 | .fetch_all( |
| 162 | Some(git_repo_path), | 165 | Some(git_repo_path), |
| @@ -166,10 +169,12 @@ async fn fetching_with_report_for_helper( | |||
| 166 | .await?; | 169 | .await?; |
| 167 | let report = consolidate_fetch_reports(relay_reports); | 170 | let report = consolidate_fetch_reports(relay_reports); |
| 168 | if report.to_string().is_empty() { | 171 | if report.to_string().is_empty() { |
| 169 | term.write_line("nostr: no updates")?; | 172 | if verbose { |
| 173 | term.write_line("nostr: no updates")?; | ||
| 174 | } | ||
| 170 | } else { | 175 | } else { |
| 171 | term.write_line(&format!("nostr updates: {report}"))?; | 176 | term.write_line(&format!("nostr updates: {report}"))?; |
| 172 | } | 177 | } |
| 173 | progress_reporter.clear()?; | 178 | let _ = progress_reporter.clear(); |
| 174 | Ok(()) | 179 | Ok(()) |
| 175 | } | 180 | } |