summaryrefslogtreecommitdiff
path: root/cli/npm/managed/cache/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/npm/managed/cache/mod.rs')
-rw-r--r--cli/npm/managed/cache/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/npm/managed/cache/mod.rs b/cli/npm/managed/cache/mod.rs
index aaec48668..8ae99f41e 100644
--- a/cli/npm/managed/cache/mod.rs
+++ b/cli/npm/managed/cache/mod.rs
@@ -36,7 +36,7 @@ pub use tarball::TarballCache;
/// Stores a single copy of npm packages in a cache.
#[derive(Debug)]
pub struct NpmCache {
- cache_dir: NpmCacheDir,
+ cache_dir: Arc<NpmCacheDir>,
cache_setting: CacheSetting,
npmrc: Arc<ResolvedNpmRc>,
/// ensures a package is only downloaded once per run
@@ -45,7 +45,7 @@ pub struct NpmCache {
impl NpmCache {
pub fn new(
- cache_dir: NpmCacheDir,
+ cache_dir: Arc<NpmCacheDir>,
cache_setting: CacheSetting,
npmrc: Arc<ResolvedNpmRc>,
) -> Self {
@@ -61,6 +61,10 @@ impl NpmCache {
&self.cache_setting
}
+ pub fn root_dir_path(&self) -> &Path {
+ self.cache_dir.root_dir()
+ }
+
pub fn root_dir_url(&self) -> &Url {
self.cache_dir.root_dir_url()
}
@@ -152,10 +156,6 @@ impl NpmCache {
self.cache_dir.package_name_folder(name, registry_url)
}
- pub fn root_folder(&self) -> PathBuf {
- self.cache_dir.root_dir().to_owned()
- }
-
pub fn resolve_package_folder_id_from_specifier(
&self,
specifier: &ModuleSpecifier,