Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli- docker-compose - swap of installation packages #848

15 changes: 6 additions & 9 deletions src/spec-node/dockerCompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,22 +703,19 @@ export function dockerComposeCLIConfig(params: Omit<PartialExecParameters, 'cmd'
let result: Promise<DockerComposeCLI>;
return () => {
return result || (result = (async () => {
let v2 = false;
let v2 = true;
let stdout: Buffer;
try {
stdout = (await dockerComposeCLI({
...params,
cmd: dockerComposeCLICmd,
}, 'version', '--short')).stdout;
cmd: dockerCLICmd,
}, 'compose', 'version', '--short')).stdout;
} catch (err) {
if (err?.code !== 'ENOENT') {
throw err;
}
stdout = (await dockerComposeCLI({
...params,
cmd: dockerCLICmd,
}, 'compose', 'version', '--short')).stdout;
v2 = true;
cmd: dockerComposeCLICmd,
}, 'version', '--short')).stdout;
v2 = false;
}
const version = stdout.toString().trim();
params.output.write(`Docker Compose version: ${version}`);
Expand Down