OSDN Git Service

suppress curl download meter if not running interactively
authorscribu <mail@scribu.net>
Thu, 11 Jul 2013 22:24:32 +0000 (01:24 +0300)
committerscribu <mail@scribu.net>
Fri, 12 Jul 2013 00:53:58 +0000 (03:53 +0300)
php/commands/core.php

index 42419f6..1efda9f 100644 (file)
@@ -38,7 +38,8 @@ class Core_Command extends WP_CLI_Command {
                        WP_CLI::log( sprintf( 'Downloading latest WordPress (%s)...', 'en_US' ) );
                }
 
-               $silent = WP_CLI::get_config('quiet') ? '--silent ' : '';
+               $silent = WP_CLI::get_config('quiet') || \cli\Shell::isPiped() ?
+                       '--silent ' : '';
 
                $cmd = "curl -f $silent %s | tar xz --strip-components=1 --directory=%s";
                WP_CLI::launch( Utils\esc_cmd( $cmd, $download_url, ABSPATH ) );