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

Function readVersionPrefix

src/spec-node/dockerCompose.ts:454–461  ·  view source on GitHub ↗
(cliHost: CLIHost, composeFiles: string[])

Source from the content-addressed store, hash-verified

452}
453
454export async function readVersionPrefix(cliHost: CLIHost, composeFiles: string[]) {
455 if (!composeFiles.length) {
456 return '';
457 }
458 const firstComposeFile = (await cliHost.readFile(composeFiles[0])).toString();
459 const version = (/^\s*(version:.*)$/m.exec(firstComposeFile) || [])[1];
460 return version ? `${version}\n\n` : '';
461}
462
463export function getDefaultImageName(dockerComposeCLI: DockerComposeCLI, projectName: string, serviceName: string) {
464 const version = parseVersion(dockerComposeCLI.version);

Callers 2

doBuildFunction · 0.90
startContainerFunction · 0.85

Calls 2

readFileMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected