OSDN Git Service

replace rename() with copy() + unlink()
authorscribu <mail@scribu.net>
Wed, 30 Oct 2013 11:40:38 +0000 (13:40 +0200)
committerscribu <mail@scribu.net>
Wed, 30 Oct 2013 11:42:53 +0000 (13:42 +0200)
php/commands/core.php

index b0ddcd2..97ebc1e 100644 (file)
@@ -111,7 +111,10 @@ class Core_Command extends WP_CLI_Command {
                                rmdir( $src );
                                continue;
                        }
-                       rename( $src, $dst );
+
+                       // rename() is not reliable inside VMs: https://github.com/wp-cli/wp-cli/issues/853
+                       copy( $src, $dst );
+                       unlink( $src );
                }
                rmdir( $source );
        }