Skip to content

Commit

Permalink
Merge pull request #330 from humanmade/backport-329-to-v8-branch
Browse files Browse the repository at this point in the history
[Backport v8-branch] Fix docker command switching logic
  • Loading branch information
roborourke authored Aug 4, 2021
2 parents d8c6a58 + d999301 commit 6899e23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/composer/class-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ protected function is_mutagen_installed() : bool {
protected function get_compose_command( string $command = '', bool $mutagen = false ) : string {
static $default_command;
if ( empty( $default_command ) ) {
exec( 'docker compose', $output, $ret );
$default_command = $ret === 0 ? 'docker compose' : 'docker-compose';
exec( 'docker compose', $output );
$default_command = strpos( implode( "\n", $output ), 'Usage: docker compose' ) !== false ? 'docker compose' : 'docker-compose';
}
return sprintf( '%s %s',
$this->is_mutagen_installed() && $mutagen ? 'mutagen compose' : $default_command,
Expand Down

0 comments on commit 6899e23

Please sign in to comment.