summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert-Jan Zwiers <34610306+GJZwiers@users.noreply.github.com>2022-03-11 01:57:57 +0100
committerGitHub <noreply@github.com>2022-03-10 19:57:57 -0500
commit38e88e32b79cf9605b57751802aef1ebff924d98 (patch)
tree03b18cc4d04c3115ed5ab3dafda7c8c49fd352cc
parent8dc26971ecf2bac3d2448337cb5c8d6037cdcf8a (diff)
fix(info): print deno info paths with unescaped backslashes on windows (#13847)
-rw-r--r--cli/main.rs33
-rw-r--r--cli/tests/testdata/041_info_flag.out10
-rw-r--r--cli/tests/testdata/041_info_flag_location.out12
3 files changed, 32 insertions, 23 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 8d0a7a2ba..3e49380d9 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -329,6 +329,8 @@ fn print_cache_info(
origin_dir.join(&checksum::gen(&[location.to_string().as_bytes()]));
}
+ let local_storage_dir = origin_dir.join("local_storage");
+
if json {
let mut output = json!({
"denoDir": deno_dir,
@@ -339,34 +341,41 @@ fn print_cache_info(
});
if location.is_some() {
- output["localStorage"] =
- serde_json::to_value(origin_dir.join("local_storage"))?;
+ output["localStorage"] = serde_json::to_value(local_storage_dir)?;
}
write_json_to_stdout(&output)
} else {
- println!("{} {:?}", colors::bold("DENO_DIR location:"), deno_dir);
println!(
- "{} {:?}",
+ "{} {}",
+ colors::bold("DENO_DIR location:"),
+ deno_dir.display()
+ );
+ println!(
+ "{} {}",
colors::bold("Remote modules cache:"),
- modules_cache
+ modules_cache.display()
);
println!(
- "{} {:?}",
+ "{} {}",
colors::bold("Emitted modules cache:"),
- typescript_cache
+ typescript_cache.display()
);
println!(
- "{} {:?}",
+ "{} {}",
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() {
println!(
- "{} {:?}",
+ "{} {}",
colors::bold("Local Storage:"),
- origin_dir.join("local_storage"),
+ local_storage_dir.display(),
);
}
Ok(())
diff --git a/cli/tests/testdata/041_info_flag.out b/cli/tests/testdata/041_info_flag.out
index ded795339..cb94386e8 100644
--- a/cli/tests/testdata/041_info_flag.out
+++ b/cli/tests/testdata/041_info_flag.out
@@ -1,5 +1,5 @@
-DENO_DIR location: "[WILDCARD]"
-Remote modules cache: "[WILDCARD]deps"
-Emitted modules cache: "[WILDCARD]gen"
-Language server registries cache: "[WILDCARD]registries"
-Origin storage: "[WILDCARD]location_data"
+DENO_DIR location: [WILDCARD]
+Remote modules cache: [WILDCARD]deps
+Emitted modules cache: [WILDCARD]gen
+Language server registries cache: [WILDCARD]registries
+Origin storage: [WILDCARD]location_data
diff --git a/cli/tests/testdata/041_info_flag_location.out b/cli/tests/testdata/041_info_flag_location.out
index 207065012..fa111cf18 100644
--- a/cli/tests/testdata/041_info_flag_location.out
+++ b/cli/tests/testdata/041_info_flag_location.out
@@ -1,6 +1,6 @@
-DENO_DIR location: "[WILDCARD]"
-Remote modules cache: "[WILDCARD]deps"
-Emitted modules cache: "[WILDCARD]gen"
-Language server registries cache: "[WILDCARD]registries"
-Origin storage: "[WILDCARD]location_data[WILDCARD]"
-Local Storage: "[WILDCARD]location_data[WILDCARD]local_storage"
+DENO_DIR location: [WILDCARD]
+Remote modules cache: [WILDCARD]deps
+Emitted modules cache: [WILDCARD]gen
+Language server registries cache: [WILDCARD]registries
+Origin storage: [WILDCARD]location_data[WILDCARD]
+Local Storage: [WILDCARD]location_data[WILDCARD]local_storage