extension-command icon indicating copy to clipboard operation
extension-command copied to clipboard

Support `--adapt-slug` to override the default directory when installing zips

Open borkweb opened this issue 3 years ago • 3 comments

The install subcommand for both plugins and themes now support the following:

  • wp [plugin|theme] install whatever.zip --adapt-slug=bork - When installing a zip (whether remote or local), the directory it gets installed to will be the value in adapt-slug; in this case, bork/'
  • wp [plugin|theme] install whatever.zip --adapt-slug - When installing a zip (whether remote or local), the plugin or theme name will be fetched from the bootstrap file or style.css respectively, slug-ify it, and then use that as the directory it gets installed to.

Fixes: #74

borkweb avatar Sep 14 '22 02:09 borkweb

@borkweb Looks pretty great so far! I kicked off the test suite to see if there are any side effects.

What do you think should happen for wp [plugin|theme] install whatever.zip whatever2.zip --adapt-slug=bork? Should we throw an error?

danielbachhuber avatar Sep 20 '22 12:09 danielbachhuber

@danielbachhuber - Oh! I that's a great question. Erroring makes a lot of sense.

borkweb avatar Sep 20 '22 12:09 borkweb

@borkweb Sounds good. Can you add a test case for that scenario? It looks like there's a coding standards issue that needs to be fixed too.

danielbachhuber avatar Sep 20 '22 12:09 danielbachhuber

Proceeding with https://github.com/wp-cli/wp-cli/issues/5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/6d013dbff6c939165c4c03c34b6477a1 in case this PR is auto-closed or broken in some way.

danielbachhuber avatar Nov 18 '22 16:11 danielbachhuber