diff options
Diffstat (limited to 'cli/npm/cache.rs')
-rw-r--r-- | cli/npm/cache.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index e39957a6b..a0082fb29 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -11,12 +11,12 @@ use deno_core::anyhow::Context; use deno_core::error::custom_error; use deno_core::error::AnyError; use deno_core::url::Url; -use deno_runtime::colors; use deno_runtime::deno_fetch::reqwest; use crate::deno_dir::DenoDir; use crate::file_fetcher::CacheSetting; use crate::fs_util; +use crate::progress_bar::ProgressBar; use super::semver::NpmVersion; use super::tarball::verify_and_extract_tarball; @@ -173,13 +173,19 @@ impl ReadonlyNpmCache { pub struct NpmCache { readonly: ReadonlyNpmCache, cache_setting: CacheSetting, + progress_bar: ProgressBar, } impl NpmCache { - pub fn from_deno_dir(dir: &DenoDir, cache_setting: CacheSetting) -> Self { + pub fn from_deno_dir( + dir: &DenoDir, + cache_setting: CacheSetting, + progress_bar: ProgressBar, + ) -> Self { Self { readonly: ReadonlyNpmCache::from_deno_dir(dir), cache_setting, + progress_bar, } } @@ -211,13 +217,7 @@ impl NpmCache { ); } - log::log!( - log::Level::Info, - "{} {}", - colors::green("Download"), - dist.tarball, - ); - + let _guard = self.progress_bar.update(&dist.tarball); let response = reqwest::get(&dist.tarball).await?; if response.status() == 404 { |