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

Function normalizeDevContainerLabelPath

src/spec-node/utils.ts:651–665  ·  view source on GitHub ↗
(platform: NodeJS.Platform, value: string)

Source from the content-addressed store, hash-verified

649}
650
651export function normalizeDevContainerLabelPath(platform: NodeJS.Platform, value: string): string {
652 if (platform !== 'win32') {
653 return value;
654 }
655
656 // Normalize separators and dot segments, then explicitly lowercase the drive
657 // letter because devcontainer.local_folder / devcontainer.config_file labels
658 // should compare case-insensitively on Windows.
659 const normalized = path.win32.normalize(value);
660 if (normalized.length >= 2 && normalized[1] === ':') {
661 return normalized[0].toLowerCase() + normalized.slice(1);
662 }
663
664 return normalized;
665}
666
667async function findDevContainerByNormalizedLabels(params: DockerResolverParameters | DockerCLIParameters, normalizedWorkspaceFolder: string, normalizedConfigFile: string) {
668 if (process.platform !== 'win32') {

Calls

no outgoing calls

Tested by

no test coverage detected