From 223403e899c934e23ea3012cc1bbba0b1a3ce92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 3 Sep 2022 15:31:01 +0200 Subject: feat(info): add information about npm modules cache (#15750) --- cli/npm/cache.rs | 4 ++++ cli/npm/mod.rs | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'cli/npm') diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index e5193c77c..e39957a6b 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -162,6 +162,10 @@ impl ReadonlyNpmCache { version: NpmVersion::parse(version).unwrap(), }) } + + pub fn get_cache_location(&self) -> PathBuf { + self.root_dir.clone() + } } /// Stores a single copy of npm packages in a cache. diff --git a/cli/npm/mod.rs b/cli/npm/mod.rs index 5b49afb3d..8272974bc 100644 --- a/cli/npm/mod.rs +++ b/cli/npm/mod.rs @@ -184,6 +184,10 @@ impl GlobalNpmPackageResolver { registry_url: self.registry_url.clone(), } } + + pub fn get_cache_location(&self) -> PathBuf { + self.cache.as_readonly().get_cache_location() + } } impl NpmPackageResolver for GlobalNpmPackageResolver { -- cgit v1.2.3