summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/cache/deno_dir.rs6
-rw-r--r--cli/cache/mod.rs11
-rw-r--r--cli/factory.rs2
-rw-r--r--cli/file_fetcher.rs12
-rw-r--r--cli/lsp/cache.rs2
5 files changed, 11 insertions, 22 deletions
diff --git a/cli/cache/deno_dir.rs b/cli/cache/deno_dir.rs
index 88d8a31c0..7b7059c22 100644
--- a/cli/cache/deno_dir.rs
+++ b/cli/cache/deno_dir.rs
@@ -126,9 +126,9 @@ impl DenoDir {
self.root.join("registries")
}
- /// Path to the dependencies cache folder.
- pub fn deps_folder_path(&self) -> PathBuf {
- self.root.join("deps")
+ /// Path to the remote cache folder.
+ pub fn remote_folder_path(&self) -> PathBuf {
+ self.root.join("remote")
}
/// Path to the origin data cache folder.
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs
index 2296bce01..628502c50 100644
--- a/cli/cache/mod.rs
+++ b/cli/cache/mod.rs
@@ -87,10 +87,6 @@ impl deno_cache_dir::DenoCacheEnv for RealDenoCacheEnv {
std::fs::create_dir_all(path)
}
- fn remove_file(&self, path: &Path) -> std::io::Result<()> {
- std::fs::remove_file(path)
- }
-
fn modified(&self, path: &Path) -> std::io::Result<Option<SystemTime>> {
match std::fs::metadata(path) {
Ok(metadata) => Ok(Some(
@@ -149,13 +145,6 @@ impl<'a> deno_cache_dir::DenoCacheEnv for DenoCacheEnvFsAdapter<'a> {
.map_err(|e| e.into_io_error())
}
- fn remove_file(&self, path: &Path) -> std::io::Result<()> {
- self
- .0
- .remove_sync(path, false)
- .map_err(|e| e.into_io_error())
- }
-
fn modified(&self, path: &Path) -> std::io::Result<Option<SystemTime>> {
self
.0
diff --git a/cli/factory.rs b/cli/factory.rs
index 2cef87599..b96a133e9 100644
--- a/cli/factory.rs
+++ b/cli/factory.rs
@@ -301,7 +301,7 @@ impl CliFactory {
pub fn global_http_cache(&self) -> Result<&Arc<GlobalHttpCache>, AnyError> {
self.services.global_http_cache.get_or_try_init(|| {
Ok(Arc::new(GlobalHttpCache::new(
- self.deno_dir()?.deps_folder_path(),
+ self.deno_dir()?.remote_folder_path(),
crate::cache::RealDenoCacheEnv,
)))
})
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs
index 1bf763594..69daf1495 100644
--- a/cli/file_fetcher.rs
+++ b/cli/file_fetcher.rs
@@ -726,7 +726,7 @@ mod tests {
maybe_temp_dir: Option<TempDir>,
) -> (FileFetcher, TempDir, Arc<BlobStore>) {
let temp_dir = maybe_temp_dir.unwrap_or_default();
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let blob_store: Arc<BlobStore> = Default::default();
let file_fetcher = FileFetcher::new(
Arc::new(GlobalHttpCache::new(location, RealDenoCacheEnv)),
@@ -964,7 +964,7 @@ mod tests {
// This creates a totally new instance, simulating another Deno process
// invocation and indicates to "cache bust".
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let file_fetcher = FileFetcher::new(
Arc::new(GlobalHttpCache::new(
location,
@@ -990,7 +990,7 @@ mod tests {
async fn test_fetch_uses_cache() {
let _http_server_guard = test_util::http_server();
let temp_dir = TempDir::new();
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let specifier =
resolve_url("http://localhost:4545/subdir/mismatch_ext.ts").unwrap();
@@ -1156,7 +1156,7 @@ mod tests {
async fn test_fetch_uses_cache_with_redirects() {
let _http_server_guard = test_util::http_server();
let temp_dir = TempDir::new();
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let specifier =
resolve_url("http://localhost:4548/subdir/mismatch_ext.ts").unwrap();
let redirected_specifier =
@@ -1324,7 +1324,7 @@ mod tests {
async fn test_fetch_no_remote() {
let _http_server_guard = test_util::http_server();
let temp_dir = TempDir::new();
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let file_fetcher = FileFetcher::new(
Arc::new(GlobalHttpCache::new(
location,
@@ -1350,7 +1350,7 @@ mod tests {
async fn test_fetch_cache_only() {
let _http_server_guard = test_util::http_server();
let temp_dir = TempDir::new();
- let location = temp_dir.path().join("deps").to_path_buf();
+ let location = temp_dir.path().join("remote").to_path_buf();
let file_fetcher_01 = FileFetcher::new(
Arc::new(GlobalHttpCache::new(location.clone(), RealDenoCacheEnv)),
CacheSetting::Only,
diff --git a/cli/lsp/cache.rs b/cli/lsp/cache.rs
index db10dc967..fbf9ea6f1 100644
--- a/cli/lsp/cache.rs
+++ b/cli/lsp/cache.rs
@@ -94,7 +94,7 @@ impl LspCache {
let deno_dir = DenoDir::new(global_cache_path)
.expect("should be infallible with absolute custom root");
let global = Arc::new(GlobalHttpCache::new(
- deno_dir.deps_folder_path(),
+ deno_dir.remote_folder_path(),
crate::cache::RealDenoCacheEnv,
));
Self {