summaryrefslogtreecommitdiff
path: root/cli/npm/registry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/npm/registry.rs')
-rw-r--r--cli/npm/registry.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/cli/npm/registry.rs b/cli/npm/registry.rs
index 1fb4b2e0a..f5b8b9fc8 100644
--- a/cli/npm/registry.rs
+++ b/cli/npm/registry.rs
@@ -21,6 +21,7 @@ use serde::Serialize;
use crate::file_fetcher::CacheSetting;
use crate::fs_util;
use crate::http_cache::CACHE_PERM;
+use crate::progress_bar::ProgressBar;
use super::cache::NpmCache;
use super::semver::NpmVersionReq;
@@ -106,6 +107,7 @@ pub struct NpmRegistryApi {
mem_cache: Arc<Mutex<HashMap<String, Option<NpmPackageInfo>>>>,
reload: bool,
cache_setting: CacheSetting,
+ progress_bar: ProgressBar,
}
impl NpmRegistryApi {
@@ -132,8 +134,15 @@ impl NpmRegistryApi {
cache: NpmCache,
reload: bool,
cache_setting: CacheSetting,
+ progress_bar: ProgressBar,
) -> Self {
- Self::from_base(Self::default_url(), cache, reload, cache_setting)
+ Self::from_base(
+ Self::default_url(),
+ cache,
+ reload,
+ cache_setting,
+ progress_bar,
+ )
}
pub fn from_base(
@@ -141,6 +150,7 @@ impl NpmRegistryApi {
cache: NpmCache,
reload: bool,
cache_setting: CacheSetting,
+ progress_bar: ProgressBar,
) -> Self {
Self {
base_url,
@@ -148,6 +158,7 @@ impl NpmRegistryApi {
mem_cache: Default::default(),
reload,
cache_setting,
+ progress_bar,
}
}
@@ -294,13 +305,7 @@ impl NpmRegistryApi {
}
let package_url = self.get_package_url(name);
-
- log::log!(
- log::Level::Info,
- "{} {}",
- colors::green("Download"),
- package_url,
- );
+ let _guard = self.progress_bar.update(package_url.as_str());
let response = match reqwest::get(package_url).await {
Ok(response) => response,