Skip to content

Commit 9361391

Browse files
committed
Use env conditionally for Windows support
1 parent b7bd1f5 commit 9361391

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DB_Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,11 @@ public function export( $args, $assoc_args ) {
550550
$assoc_args['result-file'] = $result_file;
551551
}
552552

553-
$support_column_statistics = exec( '/usr/bin/env mysqldump --help | grep "column-statistics"' );
553+
$mysqldump_binary = Utils\force_env_on_nix_systems( 'mysqldump' );
554554

555-
$initial_command = sprintf( '/usr/bin/env mysqldump%s ', $this->get_defaults_flag_string( $assoc_args ) );
555+
$support_column_statistics = exec( $mysqldump_binary . ' --help | grep "column-statistics"' );
556+
557+
$initial_command = sprintf( "{$mysqldump_binary}%s ", $this->get_defaults_flag_string( $assoc_args ) );
556558
WP_CLI::debug( "Running initial shell command: {$initial_command}", 'db' );
557559

558560
$default_arguments = [ '%s' ];

0 commit comments

Comments
 (0)