summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tools/info.rs7
-rw-r--r--cli/worker.rs17
-rw-r--r--tests/specs/info/flag/041_info_flag.out1
-rw-r--r--tests/specs/info/flag_location/041_info_flag_location.out1
-rw-r--r--tests/specs/info/json/info_json.out3
5 files changed, 20 insertions, 9 deletions
diff --git a/cli/tools/info.rs b/cli/tools/info.rs
index a417a6017..8363df9f7 100644
--- a/cli/tools/info.rs
+++ b/cli/tools/info.rs
@@ -126,6 +126,7 @@ fn print_cache_info(
let registry_cache = dir.registries_folder_path();
let mut origin_dir = dir.origin_data_folder_path();
let deno_dir = dir.root_path_for_display().to_string();
+ let web_cache_dir = crate::worker::get_cache_storage_dir();
if let Some(location) = &location {
origin_dir =
@@ -143,6 +144,7 @@ fn print_cache_info(
"typescriptCache": typescript_cache,
"registryCache": registry_cache,
"originStorage": origin_dir,
+ "webCacheStorage": web_cache_dir,
});
if location.is_some() {
@@ -177,6 +179,11 @@ fn print_cache_info(
colors::bold("Origin storage:"),
origin_dir.display()
);
+ println!(
+ "{} {}",
+ colors::bold("Web Cache storage:"),
+ web_cache_dir.display()
+ );
if location.is_some() {
println!(
"{} {}",
diff --git a/cli/worker.rs b/cli/worker.rs
index 3b09714d5..0b07bb4bf 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -393,6 +393,13 @@ impl CliMainWorker {
}
}
+// TODO(bartlomieju): this should be moved to some other place, added to avoid string
+// duplication between worker setups and `deno info` output.
+pub fn get_cache_storage_dir() -> PathBuf {
+ // Note: we currently use temp_dir() to avoid managing storage size.
+ std::env::temp_dir().join("deno_cache")
+}
+
#[derive(Clone)]
pub struct CliMainWorkerFactory {
shared: Arc<SharedWorkerState>,
@@ -529,10 +536,7 @@ impl CliMainWorkerFactory {
});
let cache_storage_dir = maybe_storage_key.map(|key| {
// TODO(@satyarohith): storage quota management
- // Note: we currently use temp_dir() to avoid managing storage size.
- std::env::temp_dir()
- .join("deno_cache")
- .join(checksum::gen(&[key.as_bytes()]))
+ get_cache_storage_dir().join(checksum::gen(&[key.as_bytes()]))
});
// TODO(bartlomieju): this is cruft, update FeatureChecker to spit out
@@ -729,10 +733,7 @@ fn create_web_worker_callback(
.resolve_storage_key(&args.main_module);
let cache_storage_dir = maybe_storage_key.map(|key| {
// TODO(@satyarohith): storage quota management
- // Note: we currently use temp_dir() to avoid managing storage size.
- std::env::temp_dir()
- .join("deno_cache")
- .join(checksum::gen(&[key.as_bytes()]))
+ get_cache_storage_dir().join(checksum::gen(&[key.as_bytes()]))
});
// TODO(bartlomieju): this is cruft, update FeatureChecker to spit out
diff --git a/tests/specs/info/flag/041_info_flag.out b/tests/specs/info/flag/041_info_flag.out
index 72a00be30..6376757c5 100644
--- a/tests/specs/info/flag/041_info_flag.out
+++ b/tests/specs/info/flag/041_info_flag.out
@@ -4,3 +4,4 @@ npm modules cache: [WILDCARD]npm
Emitted modules cache: [WILDCARD]gen
Language server registries cache: [WILDCARD]registries
Origin storage: [WILDCARD]location_data
+Web Cache storage: [WILDCARD]deno_cache
diff --git a/tests/specs/info/flag_location/041_info_flag_location.out b/tests/specs/info/flag_location/041_info_flag_location.out
index 684db2eec..07e1d2a36 100644
--- a/tests/specs/info/flag_location/041_info_flag_location.out
+++ b/tests/specs/info/flag_location/041_info_flag_location.out
@@ -4,4 +4,5 @@ npm modules cache: [WILDCARD]npm
Emitted modules cache: [WILDCARD]gen
Language server registries cache: [WILDCARD]registries
Origin storage: [WILDCARD]location_data[WILDCARD]
+Web Cache storage: [WILDCARD]deno_cache
Local Storage: [WILDCARD]location_data[WILDCARD]local_storage
diff --git a/tests/specs/info/json/info_json.out b/tests/specs/info/json/info_json.out
index 551f61026..cc43c5f10 100644
--- a/tests/specs/info/json/info_json.out
+++ b/tests/specs/info/json/info_json.out
@@ -5,5 +5,6 @@
"npmCache": "[WILDCARD]npm",
"typescriptCache": "[WILDCARD]gen",
"registryCache": "[WILDCARD]registries",
- "originStorage": "[WILDCARD]location_data"
+ "originStorage": "[WILDCARD]location_data",
+ "webCacheStorage": [WILDCARD]deno_cache"
}