Skip to content

Commit 8da6b94

Browse files
committed
sub-process fixes
1 parent 6f1fdab commit 8da6b94

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Context/FeatureContext.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,6 @@ public function proc( $command, $assoc_args = [], $path = '' ): Process {
12421242
}
12431243

12441244
wp_cli_behat_env_debug( "Running command: {$command}" );
1245-
wp_cli_behat_env_debug( "In directory: {$cwd}" );
1246-
wp_cli_behat_env_debug( "With PATH: {$env['PATH']}" );
12471245

12481246
return Process::create( $command, $cwd, $env );
12491247
}

src/Context/Process.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ public function run() {
8484
];
8585
$proc = \WP_CLI\Utils\proc_open_compat( $this->command, $descriptors, $pipes, $this->cwd, $this->env );
8686
fclose( $pipes[0] );
87-
$stdout = file_get_contents( $stdout_file );
88-
$stderr = file_get_contents( $stderr_file );
89-
unlink( $stdout_file );
90-
unlink( $stderr_file );
9187
} else {
9288
$proc = \WP_CLI\Utils\proc_open_compat( $this->command, self::$descriptors, $pipes, $this->cwd, $this->env );
9389
$stdout = stream_get_contents( $pipes[1] );
@@ -98,6 +94,13 @@ public function run() {
9894

9995
$return_code = proc_close( $proc );
10096

97+
if ( \WP_CLI\Utils\is_windows() ) {
98+
$stdout = file_get_contents( $stdout_file );
99+
$stderr = file_get_contents( $stderr_file );
100+
unlink( $stdout_file );
101+
unlink( $stderr_file );
102+
}
103+
101104
$run_time = microtime( true ) - $start_time;
102105

103106
if ( self::$log_run_times ) {

0 commit comments

Comments
 (0)