Skip to content

Commit

Permalink
Merge pull request #324 from humanmade/backport-323-to-v8-branch
Browse files Browse the repository at this point in the history
[Backport v8-branch] Use docker exec for shell
  • Loading branch information
roborourke authored Jul 30, 2021
2 parents 97e3b2b + 1cf211f commit b8274ab
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions inc/composer/class-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,19 @@ protected function shell( InputInterface $input, OutputInterface $output ) {
$columns = exec( 'tput cols' );
$lines = exec( 'tput lines' );
$command_prefix = $this->get_base_command_prefix();

$php_container_id = shell_exec( sprintf(
'%s %s',
$command_prefix,
$this->get_compose_command( 'ps -q php' )
) );

passthru( sprintf(
"$command_prefix %s exec -e COLUMNS=%d -e LINES=%d php /bin/bash",
$this->get_compose_command(),
"$command_prefix %s exec -it -e COLUMNS=%d -e LINES=%d %s /bin/bash",
'docker',
$columns,
$lines
$lines,
trim( $php_container_id )
), $return_val );

return $return_val;
Expand Down

0 comments on commit b8274ab

Please sign in to comment.