From abc3facc04401f03d68f9d496df90ebbd06fb758 Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 29 Apr 2013 19:22:31 +0300 Subject: [PATCH] core download: remove duplicate code for creating the directory --- php/commands/core.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/php/commands/core.php b/php/commands/core.php index 8f29005a..391ba140 100644 --- a/php/commands/core.php +++ b/php/commands/core.php @@ -18,7 +18,7 @@ class Core_Command extends WP_CLI_Command { if ( !is_dir( ABSPATH ) ) { WP_CLI::line( sprintf( 'Creating directory %s', ABSPATH ) ); - WP_CLI::launch( 'mkdir -p ' . escapeshellarg( ABSPATH ) ); + WP_CLI::launch( sprintf( 'mkdir -p %s', escapeshellarg( ABSPATH ) ) ); } if ( isset( $assoc_args['locale'] ) ) { @@ -35,8 +35,7 @@ class Core_Command extends WP_CLI_Command { } $silent = WP_CLI::get_config('quiet') ? ' --silent ' : ' '; - - WP_CLI::launch( sprintf( 'mkdir -p %s', escapeshellarg( ABSPATH ) ) ); + $curl_command = 'curl -f' . $silent . escapeshellarg( $download_url ); $tar_command = sprintf( 'tar xz --directory=%s --strip-components=1', escapeshellarg( ABSPATH ) ); WP_CLI::launch( $curl_command . ' | ' . $tar_command ); -- 2.11.0