Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow theme slug renaming #74

Open
ailaG opened this issue Jan 7, 2018 · 6 comments
Open

Allow theme slug renaming #74

ailaG opened this issue Jan 7, 2018 · 6 comments

Comments

@ailaG
Copy link

ailaG commented Jan 7, 2018

Please allow theme slug renaming. For example:
wp install theme .zip --slug=foo

I just encountered that need when I used URLs from GitLab. I installed a parent theme, and it was given a weird name that the host probably derives from its commit ID.
Then I tried to install its child theme, and got an error, because it couldn't find its parent theme.
If I could install the parent theme and set its slug, that wouldn't have happened.

@danielbachhuber
Copy link
Member

Please allow theme slug renaming. For example:
wp install theme .zip --slug=foo

How is this different than using unzip?

@schlessera
Copy link
Member

schlessera commented Jan 12, 2018

WP-CLI already supports an action that is similar to unzip, namely installing a plugin/theme from a ZIP file, instead of from the plugin repository.

As we already have that functionality, we should make sure that it is useful in all of the common scenarios, ZIP files having the wrong slug is a very common scenario, so I think we should add support for that.

@danielbachhuber
Copy link
Member

Couple other pieces of relevant information:

@schlessera
Copy link
Member

schlessera commented Jan 16, 2018

Yes, when I looked through the code and saw the renaming for the Github URLs, I thought we could build the slug parameter so that:

  • --adapt-slug=<name> will put the theme into a folder <name>
  • --adapt-slug will extract the ZIP, check the plugin/theme header for the name and use that as slug.

The second variation (without argument) could also be used for multiple archives.

@MetarDev
Copy link

MetarDev commented Jul 29, 2021

Yes, when I looked through the code and saw the renaming for the Github URLs, I thought we could build the slug parameter so that:

  • --adapt-slug=<name> will put the theme into a folder <name>
  • --adapt-slug will extract the ZIP, check the plugin/theme header for the name and use that as slug.

The second variation (without argument) could also be used for multiple archives.

Hi, any updates on this? Running into same issue when installing plugins from github in CI/CD as zips (have an action which builds the whole plugin and attaches is as release.zip for each release). They get extracted as release-55y616 folder (even tho the folder name inside the release.zip is just release.

That means that on each wp plugin update https://github.com/org-name/projectname/releases/download/1.2.3/release.zip it will download it into a different folder.

Having either of the two proposed options above would help solve this.

@RonGee
Copy link

RonGee commented Jul 30, 2024

No progress on this? --adapt-slug does not appear to have made it into wp-cli and wp-cli as of 2.10.0 still incorrectly names themes installed from URLs.
Error: Parameter errors:
unknown --adapt-slug parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants