diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-26 13:07:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 13:07:15 -0400 |
commit | 55a9977c6252a38fac721ad789df0c7e8acf33c9 (patch) | |
tree | b549994ba0766a1f980c0565afcf325af405902e /cli/npm | |
parent | 5f7db93d0b883abaeae392e5bd8ea5b48e9fe4b5 (diff) |
refactor(compile): remove usage of ProcState and CliOptions (#18855)
Diffstat (limited to 'cli/npm')
-rw-r--r-- | cli/npm/cache.rs | 12 |
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, |