diff options
Diffstat (limited to 'src/bin/ngit/sub_commands/apply.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/apply.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/ngit/sub_commands/apply.rs b/src/bin/ngit/sub_commands/apply.rs index 2d5d8d5..4b13975 100644 --- a/src/bin/ngit/sub_commands/apply.rs +++ b/src/bin/ngit/sub_commands/apply.rs | |||
| @@ -73,7 +73,7 @@ fn run_git_fetch(remote_name: &str) -> Result<()> { | |||
| 73 | Ok(()) | 73 | Ok(()) |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | pub async fn launch(id: &str, stdout: bool) -> Result<()> { | 76 | pub async fn launch(id: &str, stdout: bool, offline: bool) -> Result<()> { |
| 77 | let event_id = parse_event_id(id)?; | 77 | let event_id = parse_event_id(id)?; |
| 78 | 78 | ||
| 79 | let git_repo = Repo::discover().context("failed to find a git repository")?; | 79 | let git_repo = Repo::discover().context("failed to find a git repository")?; |
| @@ -91,10 +91,12 @@ pub async fn launch(id: &str, stdout: bool) -> Result<()> { | |||
| 91 | .ok() | 91 | .ok() |
| 92 | .flatten(); | 92 | .flatten(); |
| 93 | 93 | ||
| 94 | if let Some((remote_name, _)) = &nostr_remote { | 94 | if !offline { |
| 95 | run_git_fetch(remote_name)?; | 95 | if let Some((remote_name, _)) = &nostr_remote { |
| 96 | } else { | 96 | run_git_fetch(remote_name)?; |
| 97 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | 97 | } else { |
| 98 | fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; | ||
| 99 | } | ||
| 98 | } | 100 | } |
| 99 | 101 | ||
| 100 | let repo_ref = get_repo_ref_from_cache(Some(git_repo_path), &repo_coordinates).await?; | 102 | let repo_ref = get_repo_ref_from_cache(Some(git_repo_path), &repo_coordinates).await?; |