OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3789639
)
Check for existing file when trying to import CSV
author
mpeshev
<mario@peshev.net>
Thu, 8 Aug 2013 14:19:45 +0000
(17:19 +0300)
committer
mpeshev
<mario@peshev.net>
Thu, 8 Aug 2013 14:19:45 +0000
(17:19 +0300)
php/commands/user.php
patch
|
blob
|
history
diff --git
a/php/commands/user.php
b/php/commands/user.php
index
269a38d
..
d7a8a0c
100644
(file)
--- a/
php/commands/user.php
+++ b/
php/commands/user.php
@@
-582,6
+582,10
@@
class User_Command extends \WP_CLI\CommandWithDBObject {
$blog_users = get_users();
$filename = $args[0];
+
+ if (! file_exists( $filename ) ) {
+ WP_CLI::warning( "{$new_user['user_login']} has an invalid role" );
+ }
foreach ( new \WP_CLI\Iterators\CSV( $filename ) as $i => $new_user ) {
$defaults = array(