Skip to content

Commit 63e01ad

Browse files
authored
Merge pull request #528 from Rvouill/copilot/add-wp-plugin-download-command
Fix change --path parameter to --target-path parameter to avoid clashing with global parameter
2 parents 767d5da + 3e78d42 commit 63e01ad

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

features/extension-download.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Feature: Download WordPress.org extensions without loading WordPress
1919
Scenario: Downloading a plugin package to a custom path
2020
Given an empty directory
2121

22-
When I run `wp plugin download debug-bar --path=/tmp/wp-cli-download-test-plugin`
22+
When I run `wp plugin download debug-bar --target-path=/tmp/wp-cli-download-test-plugin`
2323
Then STDOUT should contain:
2424
"""
2525
Success: Downloaded plugin package to
@@ -103,7 +103,7 @@ Feature: Download WordPress.org extensions without loading WordPress
103103
Scenario: Downloading a theme package to a custom path
104104
Given an empty directory
105105

106-
When I run `wp theme download twentytwelve --path=/tmp/wp-cli-download-test-theme`
106+
When I run `wp theme download twentytwelve --target-path=/tmp/wp-cli-download-test-theme`
107107
Then STDOUT should contain:
108108
"""
109109
Success: Downloaded theme package to

src/Plugin_Download_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* <slug>
1212
* : Slug of the plugin to download.
1313
*
14-
* [--path=<path>]
14+
* [--target-path=<path>]
1515
* : Directory to store the downloaded zip file. Defaults to the current directory.
1616
*
1717
* [--version=<version>]
@@ -38,7 +38,7 @@ class Plugin_Download_Command {
3838
* Downloads a plugin zip package without loading WordPress.
3939
*
4040
* @param array{0: string} $args Positional arguments.
41-
* @param array{path?: string, version?: string, force?: bool, insecure?: bool} $assoc_args Associative arguments.
41+
* @param array{target-path?: string, version?: string, force?: bool, insecure?: bool} $assoc_args Associative arguments.
4242
*/
4343
public function __invoke( $args, $assoc_args ) {
4444
$slug = (string) $args[0];
@@ -49,7 +49,7 @@ public function __invoke( $args, $assoc_args ) {
4949
$insecure = Utils\get_flag_value( $assoc_args, 'insecure', false );
5050
$force = Utils\get_flag_value( $assoc_args, 'force', false );
5151
$requested = Utils\get_flag_value( $assoc_args, 'version', null );
52-
$download_dir = Utils\get_flag_value( $assoc_args, 'path', getcwd() );
52+
$download_dir = Utils\get_flag_value( $assoc_args, 'target-path', getcwd() );
5353

5454
if ( ! is_dir( $download_dir ) ) {
5555
if ( ! @mkdir( $download_dir, 0755, true ) ) {

src/Theme_Download_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* <slug>
1212
* : Slug of the theme to download.
1313
*
14-
* [--path=<path>]
14+
* [--target-path=<path>]
1515
* : Directory to store the downloaded zip file. Defaults to the current directory.
1616
*
1717
* [--version=<version>]
@@ -38,7 +38,7 @@ class Theme_Download_Command {
3838
* Downloads a theme zip package without loading WordPress.
3939
*
4040
* @param array{0: string} $args Positional arguments.
41-
* @param array{path?: string, version?: string, force?: bool, insecure?: bool} $assoc_args Associative arguments.
41+
* @param array{target-path?: string, version?: string, force?: bool, insecure?: bool} $assoc_args Associative arguments.
4242
*/
4343
public function __invoke( $args, $assoc_args ) {
4444
$slug = (string) $args[0];
@@ -49,7 +49,7 @@ public function __invoke( $args, $assoc_args ) {
4949
$insecure = Utils\get_flag_value( $assoc_args, 'insecure', false );
5050
$force = Utils\get_flag_value( $assoc_args, 'force', false );
5151
$requested = Utils\get_flag_value( $assoc_args, 'version', null );
52-
$download_dir = Utils\get_flag_value( $assoc_args, 'path', getcwd() );
52+
$download_dir = Utils\get_flag_value( $assoc_args, 'target-path', getcwd() );
5353

5454
if ( ! is_dir( $download_dir ) ) {
5555
if ( ! @mkdir( $download_dir, 0755, true ) ) {

0 commit comments

Comments
 (0)