Skip to content

Commit

Permalink
fix: fix support for docker compose without minus
Browse files Browse the repository at this point in the history
  • Loading branch information
thepiwo committed Jul 25, 2022
1 parent 2ba0293 commit 84561fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/env/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const { nodeConfiguration, compilerConfiguration, proxyConfiguration } = require
let dockerComposeCmd = 'docker compose';

async function getDockerCompose() {
const dockerSpaceCompose = await spawn('docker compose').catch(() => ({ code: 1 }));
const dockerSpaceCompose = await spawn('docker', ['compose']).catch(() => ({ code: 1 }));
console.log('dockerSpaceCompose', dockerSpaceCompose);
if (dockerSpaceCompose.code === 0) return;
const dockerMinusCompose = await spawn('docker-compose').catch(() => ({ code: 1 }));
console.log('dockerMinusCompose', dockerMinusCompose);
if (dockerMinusCompose.code === 0) {
dockerComposeCmd = 'docker-compose';
return;
Expand Down Expand Up @@ -63,10 +65,7 @@ async function stopEnv(running) {
print('===== stopping env =====');

await getDockerCompose();
await spawn(dockerComposeCmd, [
'down',
'-v',
]);
await exec(`${dockerComposeCmd} down -v`);

print('===== Env was successfully stopped! =====');
}
Expand Down

0 comments on commit 84561fe

Please sign in to comment.