Skip to content

Commit b4a0372

Browse files
committed
No is_executable check on Windows
SOmehow returns false even though `.bat` is supposed to always return true? 🤷
1 parent a299ad2 commit b4a0372

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Context/FeatureContext.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,12 @@ public static function get_bin_path(): ?string {
408408

409409
$bin = Utils\is_windows() ? 'wp.bat' : 'wp';
410410

411-
wp_cli_behat_env_debug( 'Searching for WP-CLI binary...' );
412411
foreach ( $bin_paths as $path ) {
413412
$full_bin_path = $path . DIRECTORY_SEPARATOR . $bin;
414-
wp_cli_behat_env_debug( "Checking path: {$full_bin_path}" );
415-
wp_cli_behat_env_debug( 'is_file: ' . ( is_file( $full_bin_path ) ? 'true' : 'false' ) );
416-
wp_cli_behat_env_debug( 'is_executable: ' . ( is_executable( $full_bin_path ) ? 'true' : 'false' ) );
417-
if ( is_file( $full_bin_path ) && is_executable( $full_bin_path ) ) {
418-
wp_cli_behat_env_debug( "Found at: {$path}" );
413+
if ( is_file( $full_bin_path ) && ( Utils\is_windows() || is_executable( $full_bin_path ) ) ) {
419414
return $path;
420415
}
421416
}
422-
wp_cli_behat_env_debug( 'WP-CLI binary not found in search paths.' );
423417

424418
return null;
425419
}

0 commit comments

Comments
 (0)