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

Plugin with basename foo.zip is not installed #773

Open
hirasso opened this issue Nov 6, 2024 · 4 comments
Open

Plugin with basename foo.zip is not installed #773

hirasso opened this issue Nov 6, 2024 · 4 comments

Comments

@hirasso
Copy link

hirasso commented Nov 6, 2024

Hey there, nice work on this plugin! Many tooling things to learn while browsing the code :)

The readme states this:

You could use arbitrary path or URL to check a plugin. For example, to check a plugin from a URL: wp plugin check https://example.com/plugin.zip or to check a plugin from a path: wp plugin check /path/to/plugin

I have created composer script in my plugin that creates a test dist-archive:

{
  "test:dist-archive": [
    "wp package install wp-cli/dist-archive-command",
    "config/scripts/generate-distignore.sh",
    "wp dist-archive . $(basename \"$(pwd)\").zip"
  ]
}

I run it like this:

composer test:dist-archive

That successfully creates a nice plugin.zip above my plugin in the /plugins folder. Now, according to the above cite from the readme, shouldn't I be able to do this?

wp plugin check ../plugin.zip

That fails with the error:

Error: Invalid plugin basename: Plugin with basename ../plugin.zip is not installed.

It indeed isn't installed. But I would love to be able to check it without needing to install it – otherwise this will be a painful manual process...

@swissspidy
Copy link
Member

I haven't checked, but I don't think we support testing a local ZIP file. It's either a URL to a ZIP file or a path to a directory.

When using wp dist-archive you can use unzip afterwards to have a directory that can be checked. That's what most people using wp dist-archive do.

@ernilambar
Copy link
Member

Yes, local zip in not supported yet.

@hirasso
Copy link
Author

hirasso commented Nov 7, 2024

Is this on the roadmap?

@swissspidy
Copy link
Member

Not sure it‘s worth it, you could just unzip it yourself with a single command or double click.

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

No branches or pull requests

3 participants