Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsaini04 committed Jun 18, 2024
1 parent 415768b commit c90ce09
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/spec-node/dockerCompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,13 @@ async function useNewProjectName(params: DockerCLIParameters | DockerResolverPar
}
}

export function dockerComposeCLIConfig(params: Omit<PartialExecParameters, 'cmd'>, dockerComposeCLICmd: string) {
export function dockerComposeCLIConfig(params: Omit<PartialExecParameters, 'cmd'>, dockerCLICmd: string, dockerComposeCLICmd: string) {
let result: Promise<DockerComposeCLI>;
return () => {
return result || (result = (async () => {
let v2 = false;
let stdout: Buffer;
dockerCLICmd='docker-compose';
try {
stdout = (await dockerComposeCLI({
...params,
Expand All @@ -716,15 +717,15 @@ export function dockerComposeCLIConfig(params: Omit<PartialExecParameters, 'cmd'
}
stdout = (await dockerComposeCLI({
...params,
cmd: 'docker-compose',
cmd: dockerCLICmd,
}, 'version', '--short')).stdout;
v2 = true;
}
const version = stdout.toString().trim();
params.output.write(`Docker Compose version: ${version}`);
return {
version,
cmd: v2 ? 'docker-compose' : dockerComposeCLICmd,
cmd: v2 ? dockerCLICmd : dockerComposeCLICmd,
args: v2 ? [] : ['compose'],
};
})());
Expand Down

0 comments on commit c90ce09

Please sign in to comment.