diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-09-03 15:31:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-03 15:31:01 +0200 |
commit | 223403e899c934e23ea3012cc1bbba0b1a3ce92a (patch) | |
tree | 99d092a16eae7b82d6c6b77c85a95277ddda2354 /cli/npm | |
parent | 26f5d608ee01eab380f6eb24b141b7d2a81888fc (diff) |
feat(info): add information about npm modules cache (#15750)
Diffstat (limited to 'cli/npm')
-rw-r--r-- | cli/npm/cache.rs | 4 | ||||
-rw-r--r-- | cli/npm/mod.rs | 4 |
2 files changed, 8 insertions, 0 deletions
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 { |