Skip to content

Commit

Permalink
Merge pull request #143 from wp-cli/fix/no-interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored Jan 8, 2022
2 parents 077a8e4 + 24741ab commit 83031c7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,13 @@ public function install_wp_with_composer( $vendor_directory = 'vendor' ) {
$yml_path = $this->variables['RUN_DIR'] . '/wp-cli.yml';
file_put_contents( $yml_path, 'path: WordPress' );

$this->composer_command( 'init --name="wp-cli/composer-test" --type="project" --no-interaction' );
$this->composer_command( 'init --name="wp-cli/composer-test" --type="project"' );
$this->composer_command( 'config vendor-dir ' . $vendor_directory );
$this->composer_command( 'config extra.wordpress-install-dir WordPress --no-interaction' );
$this->composer_command( 'require johnpbloch/wordpress-core-installer johnpbloch/wordpress-core --optimize-autoloader --no-interaction' );
$this->composer_command( 'config extra.wordpress-install-dir WordPress' );
$this->composer_command( 'require johnpbloch/wordpress-core-installer johnpbloch/wordpress-core --optimize-autoloader' );

// Allow for all Composer plugins to run to avoid warnings.
$this->composer_command( 'config allow-plugins true' );

// Disable WP Cron by default to avoid bogus HTTP requests in CLI context.
$config_extra_php = "if ( ! defined( 'DISABLE_WP_CRON' ) ) { define( 'DISABLE_WP_CRON', true ); }\n";
Expand Down Expand Up @@ -982,7 +985,7 @@ public function composer_add_wp_cli_local_repository() {
public function composer_require_current_wp_cli() {
$this->composer_add_wp_cli_local_repository();
// TODO: Specific alias version should be deduced to keep up-to-date.
$this->composer_command( 'require "wp-cli/wp-cli:dev-master as v2.5.x-dev" --optimize-autoloader --no-interaction' );
$this->composer_command( 'require "wp-cli/wp-cli:dev-master as 2.5.x-dev" --optimize-autoloader' );
}

public function start_php_server( $subdir = '' ) {
Expand All @@ -1005,7 +1008,7 @@ private function composer_command( $cmd ) {
if ( ! isset( $this->variables['COMPOSER_PATH'] ) ) {
$this->variables['COMPOSER_PATH'] = exec( 'which composer' );
}
$this->proc( $this->variables['COMPOSER_PATH'] . ' ' . $cmd )->run_check();
$this->proc( $this->variables['COMPOSER_PATH'] . ' --no-interaction ' . $cmd )->run_check();
}

/**
Expand Down

0 comments on commit 83031c7

Please sign in to comment.