Skip to content

Commit

Permalink
Minor tweak to install_hooks (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 authored Dec 11, 2024
1 parent 596dd10 commit d643529
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli/run/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,10 @@ pub async fn install_hooks(hooks: &[Hook], reporter: &HookInstallReporter) -> Re
.iter()
.filter(|hook| !hook.installed())
.unique_by(|hook| hook.install_key())
.filter(|hook| hook.environment_dir().is_some());
.filter_map(|hook| hook.environment_dir().map(|env_dir| (hook, env_dir)));

let mut tasks = futures::stream::iter(to_install)
.map(|hook| async move {
let env_dir = hook.environment_dir().expect("environment_dir is None");
.map(|(hook, env_dir)| async move {
let progress = reporter.on_install_start(hook);
let result = install_hook(hook, env_dir).await;
reporter.on_install_complete(progress);
Expand Down

0 comments on commit d643529

Please sign in to comment.