OSDN Git Service

The Windows version of tar doesn't play nicely with pipes. This way is more cross...
authorVeered <lucashansne@gmail.com>
Thu, 18 Jul 2013 23:42:38 +0000 (16:42 -0700)
committerVeered <lucashansne@gmail.com>
Thu, 18 Jul 2013 23:42:38 +0000 (16:42 -0700)
php/commands/core.php

index 1efda9f..fa31422 100644 (file)
@@ -40,8 +40,9 @@ class Core_Command extends WP_CLI_Command {
 
                $silent = WP_CLI::get_config('quiet') || \cli\Shell::isPiped() ?
                        '--silent ' : '';
-
-               $cmd = "curl -f $silent %s | tar xz --strip-components=1 --directory=%s";
+        
+               $temp = tempnam(sys_get_temp_dir(), "wp_");
+               $cmd = "curl -f $silent %s > $temp && tar xz --strip-components=1 --directory=%s -f $temp && rm $temp";
                WP_CLI::launch( Utils\esc_cmd( $cmd, $download_url, ABSPATH ) );
 
                WP_CLI::success( 'WordPress downloaded.' );