File tree Expand file tree Collapse file tree 4 files changed +0
-35
lines changed
Expand file tree Collapse file tree 4 files changed +0
-35
lines changed Original file line number Diff line number Diff line change 164164## Preview
165165
166166- Correct redirect for VS Code Server (#3352 ) (Thank you, @benz0li !)
167- - Correct redirect for GitHub Codespaces
168167
169168## LUA
170169
Original file line number Diff line number Diff line change @@ -74,8 +74,6 @@ import { projectOutputDir } from "../../project/project-shared.ts";
7474import { projectContext } from "../../project/project-context.ts" ;
7575import { normalizePath , pathWithForwardSlashes } from "../../core/path.ts" ;
7676import {
77- gitHubCodeSpacesProxyUri ,
78- isGitHubCodespaces ,
7977 isJupyterHubServer ,
8078 isRStudioServer ,
8179 isRStudioWorkbench ,
@@ -752,9 +750,6 @@ function pdfFileRequestHandler(
752750 : isVSCodeServer ( )
753751 ? vsCodeServerProxyUri ( ) ! . replace ( "{{port}}" , `${ port } ` ) +
754752 kPdfJsInitialPath
755- : isGitHubCodespaces ( )
756- ? gitHubCodeSpacesProxyUri ( ) ! . replace ( "{{port}}" , `${ port } ` ) +
757- kPdfJsInitialPath
758753 : "/" + kPdfJsInitialPath ;
759754 return Promise . resolve ( serveRedirect ( url ) ) ;
760755 } else {
Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ import { resourceFilesFromRenderedFile } from "./resources.ts";
2121import { RenderFlags , RenderOptions , RenderResult } from "./types.ts" ;
2222import { fileExecutionEngine } from "../../execute/engine.ts" ;
2323import {
24- gitHubCodeSpacesProxyUri ,
25- isGitHubCodespaces ,
2624 isJupyterHubServer ,
2725 isJupyterServer ,
2826 isRStudioServer ,
@@ -190,10 +188,6 @@ export async function printBrowsePreviewMessage(
190188 const browseUrl = proxyUrl . replace ( "{{port}}" , `${ port } ` ) +
191189 path ;
192190 info ( `\nBrowse at ${ browseUrl } ` , { format : colors . green } ) ;
193- } else if ( isVSCodeTerminal ( ) && isGitHubCodespaces ( ) ) {
194- const browseUrl =
195- gitHubCodeSpacesProxyUri ( ) ! . replace ( "{{port}}" , `${ port } ` ) + path ;
196- info ( `\nBrowse at ${ browseUrl } ` , { format : colors . green } ) ;
197191 } else if ( isJupyterHubServer ( ) ) {
198192 const httpReferrer = `${
199193 jupyterHubHttpReferrer ( ) || "<jupyterhub-server-url>/"
Original file line number Diff line number Diff line change @@ -33,29 +33,6 @@ export function isVSCodeTerminal() {
3333 return Deno . env . get ( "TERM_PROGRAM" ) === "vscode" ;
3434}
3535
36- export function gitHubCodespaceName ( ) {
37- return Deno . env . get ( "CODESPACE_NAME" ) ;
38- }
39-
40- export function gitHubCodespacePortForwardingDomain ( ) {
41- return Deno . env . get ( "GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN" ) ;
42- }
43-
44- export function isGitHubCodespaces ( ) {
45- return ! ! gitHubCodespacePortForwardingDomain ( ) && ! ! gitHubCodespaceName ( ) ;
46- }
47-
48- export function gitHubCodeSpacesProxyUri ( ) {
49- const CODESPACE_NAME = gitHubCodespaceName ( ) ;
50- const GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN =
51- gitHubCodespacePortForwardingDomain ( ) ;
52- if ( CODESPACE_NAME && GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN ) {
53- return `https://${ CODESPACE_NAME } -{{port}}.${ GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN } ` ;
54- } else {
55- return undefined ;
56- }
57- }
58-
5936export function isVSCodeServer ( ) {
6037 return ! ! vsCodeServerProxyUri ( ) ;
6138}
You can’t perform that action at this time.
0 commit comments