Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cli/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,12 @@ impl CliFactory {
self.text_only_progress_bar().clone(),
)),
match resolver_factory.npm_resolver()?.as_managed() {
Some(managed_npm_resolver) => Arc::new(
DenoTaskLifeCycleScriptsExecutor::new(managed_npm_resolver.clone()),
)
as Arc<dyn LifecycleScriptsExecutor>,
Some(managed_npm_resolver) => {
Arc::new(DenoTaskLifeCycleScriptsExecutor::new(
managed_npm_resolver.clone(),
self.text_only_progress_bar().clone(),
)) as Arc<dyn LifecycleScriptsExecutor>
}
None => Arc::new(NullLifecycleScriptsExecutor),
},
self.text_only_progress_bar().clone(),
Expand Down
16 changes: 10 additions & 6 deletions cli/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ pub enum DenoTaskLifecycleScriptsError {
}

pub struct DenoTaskLifeCycleScriptsExecutor {
progress_bar: ProgressBar,
npm_resolver: ManagedNpmResolverRc<CliSys>,
}

Expand Down Expand Up @@ -348,10 +349,7 @@ impl LifecycleScriptsExecutor for DenoTaskLifeCycleScriptsExecutor {
{
continue;
}
let pb = ProgressBar::new(
crate::util::progress_bar::ProgressBarStyle::TextOnly,
);
let _guard = pb.update_with_prompt(
let _guard = self.progress_bar.update_with_prompt(
ProgressMessagePrompt::Initialize,
&format!("{}: running '{script_name}' script", package.id.nv),
);
Expand Down Expand Up @@ -444,8 +442,14 @@ impl LifecycleScriptsExecutor for DenoTaskLifeCycleScriptsExecutor {
}

impl DenoTaskLifeCycleScriptsExecutor {
pub fn new(npm_resolver: ManagedNpmResolverRc<CliSys>) -> Self {
Self { npm_resolver }
pub fn new(
npm_resolver: ManagedNpmResolverRc<CliSys>,
progress_bar: ProgressBar,
) -> Self {
Self {
npm_resolver,
progress_bar,
}
}

// take in all (non copy) packages from snapshot,
Expand Down
Loading