summaryrefslogtreecommitdiff
path: root/cli/npm/cache.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/npm/cache.rs')
-rw-r--r--cli/npm/cache.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs
index eb674d3cb..0d88109de 100644
--- a/cli/npm/cache.rs
+++ b/cli/npm/cache.rs
@@ -129,7 +129,7 @@ impl Default for ReadonlyNpmCache {
// This only gets used when creating the tsc runtime and for testing, and so
// it shouldn't ever actually access the DenoDir, so it doesn't support a
// custom root.
- Self::from_deno_dir(&DenoDir::new(None).unwrap())
+ Self::new(DenoDir::new(None).unwrap().npm_folder_path())
}
}
@@ -155,10 +155,6 @@ impl ReadonlyNpmCache {
}
}
- pub fn from_deno_dir(dir: &DenoDir) -> Self {
- Self::new(dir.npm_folder_path())
- }
-
pub fn root_dir_url(&self) -> &Url {
&self.root_dir_url
}
@@ -306,14 +302,14 @@ pub struct NpmCache {
}
impl NpmCache {
- pub fn from_deno_dir(
- dir: &DenoDir,
+ pub fn new(
+ cache_dir_path: PathBuf,
cache_setting: CacheSetting,
http_client: HttpClient,
progress_bar: ProgressBar,
) -> Self {
Self {
- readonly: ReadonlyNpmCache::from_deno_dir(dir),
+ readonly: ReadonlyNpmCache::new(cache_dir_path),
cache_setting,
http_client,
progress_bar,