1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

fix(info): print deno info paths with unescaped backslashes on windows (#13847)

This commit is contained in:
Geert-Jan Zwiers 2022-03-11 01:57:57 +01:00 committed by GitHub
parent 8dc26971ec
commit 38e88e32b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 23 deletions

View file

@ -329,6 +329,8 @@ fn print_cache_info(
origin_dir.join(&checksum::gen(&[location.to_string().as_bytes()])); origin_dir.join(&checksum::gen(&[location.to_string().as_bytes()]));
} }
let local_storage_dir = origin_dir.join("local_storage");
if json { if json {
let mut output = json!({ let mut output = json!({
"denoDir": deno_dir, "denoDir": deno_dir,
@ -339,34 +341,41 @@ fn print_cache_info(
}); });
if location.is_some() { if location.is_some() {
output["localStorage"] = output["localStorage"] = serde_json::to_value(local_storage_dir)?;
serde_json::to_value(origin_dir.join("local_storage"))?;
} }
write_json_to_stdout(&output) write_json_to_stdout(&output)
} else { } else {
println!("{} {:?}", colors::bold("DENO_DIR location:"), deno_dir);
println!( println!(
"{} {:?}", "{} {}",
colors::bold("DENO_DIR location:"),
deno_dir.display()
);
println!(
"{} {}",
colors::bold("Remote modules cache:"), colors::bold("Remote modules cache:"),
modules_cache modules_cache.display()
); );
println!( println!(
"{} {:?}", "{} {}",
colors::bold("Emitted modules cache:"), colors::bold("Emitted modules cache:"),
typescript_cache typescript_cache.display()
); );
println!( println!(
"{} {:?}", "{} {}",
colors::bold("Language server registries cache:"), colors::bold("Language server registries cache:"),
registry_cache, registry_cache.display(),
);
println!(
"{} {}",
colors::bold("Origin storage:"),
origin_dir.display()
); );
println!("{} {:?}", colors::bold("Origin storage:"), origin_dir);
if location.is_some() { if location.is_some() {
println!( println!(
"{} {:?}", "{} {}",
colors::bold("Local Storage:"), colors::bold("Local Storage:"),
origin_dir.join("local_storage"), local_storage_dir.display(),
); );
} }
Ok(()) Ok(())

View file

@ -1,5 +1,5 @@
DENO_DIR location: "[WILDCARD]" DENO_DIR location: [WILDCARD]
Remote modules cache: "[WILDCARD]deps" Remote modules cache: [WILDCARD]deps
Emitted modules cache: "[WILDCARD]gen" Emitted modules cache: [WILDCARD]gen
Language server registries cache: "[WILDCARD]registries" Language server registries cache: [WILDCARD]registries
Origin storage: "[WILDCARD]location_data" Origin storage: [WILDCARD]location_data

View file

@ -1,6 +1,6 @@
DENO_DIR location: "[WILDCARD]" DENO_DIR location: [WILDCARD]
Remote modules cache: "[WILDCARD]deps" Remote modules cache: [WILDCARD]deps
Emitted modules cache: "[WILDCARD]gen" Emitted modules cache: [WILDCARD]gen
Language server registries cache: "[WILDCARD]registries" Language server registries cache: [WILDCARD]registries
Origin storage: "[WILDCARD]location_data[WILDCARD]" Origin storage: [WILDCARD]location_data[WILDCARD]
Local Storage: "[WILDCARD]location_data[WILDCARD]local_storage" Local Storage: [WILDCARD]location_data[WILDCARD]local_storage