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

Function dockerComposeCLIConfig

src/spec-node/dockerCompose.ts:704–731  ·  view source on GitHub ↗
(params: Omit<PartialExecParameters, 'cmd'>, dockerCLICmd: string, dockerComposeCLICmd: string)

Source from the content-addressed store, hash-verified

702}
703
704export function dockerComposeCLIConfig(params: Omit<PartialExecParameters, 'cmd'>, dockerCLICmd: string, dockerComposeCLICmd: string) {
705 let result: Promise<DockerComposeCLI>;
706 return () => {
707 return result || (result = (async () => {
708 let v2 = true;
709 let stdout: Buffer;
710 try {
711 stdout = (await dockerComposeCLI({
712 ...params,
713 cmd: dockerCLICmd,
714 }, 'compose', 'version', '--short')).stdout;
715 } catch (err) {
716 stdout = (await dockerComposeCLI({
717 ...params,
718 cmd: dockerComposeCLICmd,
719 }, 'version', '--short')).stdout;
720 v2 = false;
721 }
722 const version = stdout.toString().trim();
723 params.output.write(`Docker Compose version: ${version}`);
724 return {
725 version,
726 cmd: v2 ? dockerCLICmd : dockerComposeCLICmd,
727 args: v2 ? ['compose'] : [],
728 };
729 })());
730 };
731}
732
733/**
734 * Convert mount command arguments to Docker Compose volume

Callers 4

createCLIParamsFunction · 0.90
createDockerParamsFunction · 0.90
featuresUpgradeFunction · 0.90
readConfigurationFunction · 0.90

Calls 2

dockerComposeCLIFunction · 0.90
writeMethod · 0.65

Tested by

no test coverage detected