Skip to content

Commit

Permalink
Fix progress bars, add a homebrew release formula
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Mar 5, 2023
1 parent 708aac9 commit b430254
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
push:
tags:
- 'v*'

jobs:
homebrew:
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v2
with:
formula-name: gping
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ fn lock(workspace: &Path) -> anyhow::Result<()> {
// For each source, in sequence, fetch the repositories
let results = sources
.par_iter()
.progress_with(total_bar)
.map(|source| {
source
.fetch_repositories()
.with_context(|| format!("Error fetching repositories from {}", source))
})
.progress_with(total_bar)
.collect::<anyhow::Result<Vec<_>>>()?;
let mut all_repositories: Vec<Repository> = results.into_iter().flatten().collect();
// let all_repositories: Vec<Repository> = all_repository_results.iter().collect::<anyhow::Result<Vec<Repository>>>()?;
Expand Down Expand Up @@ -443,7 +443,6 @@ where
repositories
.par_iter()
// Update our progress bar with each iteration
.progress_with(total_bar)
.map(|repo| {
// Create a progress bar and configure some defaults
let progress_bar = progress.add(ProgressBar::new_spinner());
Expand All @@ -467,6 +466,7 @@ where
progress_bar.finish_and_clear();
result
})
.progress_with(total_bar)
// We only care about errors here, so filter them out.
.filter_map(Result::err)
// Collect the results into a Vec
Expand Down

0 comments on commit b430254

Please sign in to comment.