Skip to content

Commit

Permalink
Merge pull request #111 from humanmade/shell-run-as-root
Browse files Browse the repository at this point in the history
Improvements to shell command
  • Loading branch information
joehoyle authored Jan 10, 2020
2 parents b33b667 + 0383029 commit 054002e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions inc/composer/class-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function start( InputInterface $input, OutputInterface $output ) {

// Check install was successful.
if ( $install_failed ) {
$output->writeln( '<error>WordPress install failed.</>' );
$output->writeln( sprintf( '<error>WordPress install failed. Exited with error code %d</>', $install_failed ) );
return $install_failed;
}

Expand Down Expand Up @@ -318,11 +318,15 @@ protected function logs( InputInterface $input, OutputInterface $output ) {
}

protected function shell( InputInterface $input, OutputInterface $output ) {
$columns = exec( 'tput cols' );
$lines = exec( 'tput lines' );
passthru( sprintf(
'cd %s; VOLUME=%s COMPOSE_PROJECT_NAME=%s docker-compose exec php /bin/bash',
'cd %s; VOLUME=%s COMPOSE_PROJECT_NAME=%s docker-compose exec -e COLUMNS=%d -e LINES=%d php /bin/bash',
'vendor/altis/local-server/docker',
escapeshellarg( getcwd() ),
$this->get_project_subdomain()
$this->get_project_subdomain(),
$columns,
$lines
), $return_val );

return $return_val;
Expand Down

0 comments on commit 054002e

Please sign in to comment.