diff --git a/src/Shell_Command.php b/src/Shell_Command.php index 4109277..c2ec3ad 100644 --- a/src/Shell_Command.php +++ b/src/Shell_Command.php @@ -2,6 +2,7 @@ use EE\Model\Site; use function EE\Site\Utils\auto_site_name; +use function EE\Utils\get_flag_value; /** * Brings up a shell to run wp-cli, composer etc. @@ -35,6 +36,9 @@ class Shell_Command extends EE_Command { * [--command=] * : Command to non-interactively run in the shell. * + * [--skip-tty] + * : Skips tty allocation. + * * ## EXAMPLES * * # Open shell for site @@ -75,8 +79,11 @@ public function __invoke( $args, $assoc_args ) { $shell = ( 'mailhog' === $service ) ? 'sh' : 'bash'; $command = \EE\Utils\get_flag_value( $assoc_args, 'command' ); + + $tty = get_flag_value( $assoc_args, 'skip-tty' ) ? '-T' : ''; + if ( $command ) { - EE::exec( "docker-compose exec $user_string $service $shell -c \"$command\"", true, true ); + EE::exec( "docker-compose exec $tty $user_string $service $shell -c \"$command\"", true, true ); } else { $this->run( "docker-compose exec $user_string $service $shell" ); }