Skip to content

Commit

Permalink
fix(install): percent encodings in interactive progress bar (denoland…
Browse files Browse the repository at this point in the history
…#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 denoland#26576
  • Loading branch information
marvinhagemeister authored Oct 29, 2024
1 parent 3b28446 commit c8d229d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/util/progress_bar/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
Expand Down

0 comments on commit c8d229d

Please sign in to comment.