Skip to content

Commit

Permalink
Modify the path depending on VSCODE_PROXY_URI
Browse files Browse the repository at this point in the history
thx to @benz0li
  • Loading branch information
dragonstyle committed Nov 15, 2022
1 parent ccd2d09 commit e0c4d8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/command/render/render-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ export async function printBrowsePreviewMessage(
info(`\nPreview server: ${previewURL(host, port, path = "")}`);
info(`\nBrowse at ${url}`, { format: colors.green });
} else if (isVSCodeTerminal() && isVSCodeServer()) {
const sep = path.startsWith("/") ? "" : "/";
if (vsCodeServerProxyUri().endsWith("/")) {
path = path.startsWith("/") ? path.slice(1) : path;
} else {
path = path.startsWith("/") ? path : "/" + path;
}
const browseUrl = vsCodeServerProxyUri()!.replace("{{port}}", `${port}`) +
sep + path;
info(`\nBrowse at ${browseUrl}`, { format: colors.green });
Expand Down

0 comments on commit e0c4d8d

Please sign in to comment.