MCPcopy Index your code
hub / github.com/devcontainers/cli / uriToFsPath

Function uriToFsPath

src/spec-configuration/configurationCommonUtils.ts:24–45  ·  view source on GitHub ↗
(uri: URI, platform: NodeJS.Platform)

Source from the content-addressed store, hash-verified

22}
23
24export function uriToFsPath(uri: URI, platform: NodeJS.Platform): string {
25
26 let value: string;
27 if (uri.authority && uri.path.length > 1 && (uri.scheme === 'file' || uri.scheme === CLIHostDocuments.scheme)) {
28 // unc path: file://shares/c$/far/boo
29 value = `//${uri.authority}${uri.path}`;
30 } else if (
31 uri.path.charCodeAt(0) === CharCode.Slash
32 && (uri.path.charCodeAt(1) >= CharCode.A && uri.path.charCodeAt(1) <= CharCode.Z || uri.path.charCodeAt(1) >= CharCode.a && uri.path.charCodeAt(1) <= CharCode.z)
33 && uri.path.charCodeAt(2) === CharCode.Colon
34 ) {
35 // windows drive letter: file:///c:/far/boo
36 value = uri.path[1].toLowerCase() + uri.path.substr(2);
37 } else {
38 // other path
39 value = uri.path;
40 }
41 if (platform === 'win32') {
42 value = value.replace(/\//g, '\\');
43 }
44 return value;
45}
46
47export function getWellKnownDevContainerPaths(path_: typeof path.posix | typeof path.win32, folderPath: string): string[] {
48 return [

Callers 15

generateFeaturesConfigFunction · 0.90
readDocumentMethod · 0.90
applyEditsMethod · 0.90
uriToWSLFsPathFunction · 0.90
getConfigFunction · 0.90
doSetUpFunction · 0.90
doBuildFunction · 0.90
doRunUserCommandsFunction · 0.90
readConfigurationFunction · 0.90
outdatedFunction · 0.90
doExecFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected