summaryrefslogtreecommitdiff
path: root/cli/util/progress_bar/renderer.rs
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-10-30 00:35:42 +0100
committerGitHub <noreply@github.com>2024-10-29 23:35:42 +0000
commitc8d229dbf03177e81f4fd2f43c7daf74a7f2e283 (patch)
tree4ca125ed13e37e4fb76e40ab4e1070cae9bd4ef3 /cli/util/progress_bar/renderer.rs
parent3b28446000d8d063c07ef320314ef493a9e0bffa (diff)
fix(install): percent encodings in interactive progress bar (#26600)
Fixes percent encodings showing up when installing scoped packages via `deno add` or `deno install`. The issue is caused by us trying to map back the package name from the resolved http url. This doesn't and has never worked with private registries. The proper solution would be to pass the original specifier into here, but that's a bit of a bigger refactor. So for now the quickest workaround is to replace `%2f` back to `/`. Fixes https://github.com/denoland/deno/issues/26576
Diffstat (limited to 'cli/util/progress_bar/renderer.rs')
-rw-r--r--cli/util/progress_bar/renderer.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/util/progress_bar/renderer.rs b/cli/util/progress_bar/renderer.rs
index a83ceb333..6b08dada1 100644
--- a/cli/util/progress_bar/renderer.rs
+++ b/cli/util/progress_bar/renderer.rs
@@ -193,10 +193,16 @@ impl ProgressBarRenderer for TextOnlyProgressBarRenderer {
}
};
+ // TODO(@marvinhagemeister): We're trying to reconstruct the original
+ // specifier from the resolved one, but we lack the information about
+ // private registries URLs and other things here.
let message = display_entry
.message
.replace("https://registry.npmjs.org/", "npm:")
- .replace("https://jsr.io/", "jsr:");
+ .replace("https://jsr.io/", "jsr:")
+ .replace("%2f", "/")
+ .replace("%2F", "/");
+
display_str.push_str(
&colors::gray(format!(" - {}{}\n", message, bytes_text)).to_string(),
);