Skip to content

Commit 1e81950

Browse files
authored
Fix output message for STDIN input (#151)
Fix output message for STDIN input
2 parents a5bcd3e + bae9e17 commit 1e81950

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

features/db-import.feature

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Feature: Import a WordPress database
1212
Success: Imported from 'wp_cli_test.sql'.
1313
"""
1414

15+
Scenario: Import from STDIN
16+
Given a WP install
17+
18+
When I run `wp db import -`
19+
Then STDOUT should be:
20+
"""
21+
Success: Imported from 'STDIN'.
22+
"""
23+
1524
Scenario: Import from database name path by default and skip speed optimization
1625
Given a WP install
1726

src/DB_Command.php

+2
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ public function import( $args, $assoc_args ) {
580580
: 'SET autocommit = 0; SET unique_checks = 0; SET foreign_key_checks = 0; SOURCE %s; COMMIT;';
581581

582582
$mysql_args['execute'] = sprintf( $query, $result_file );
583+
} else {
584+
$result_file = 'STDIN';
583585
}
584586
// Check if any mysql option pass.
585587
$mysql_args = array_merge( $mysql_args, self::get_mysql_args( $assoc_args ) );

0 commit comments

Comments
 (0)