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

How to run composer install before make the dist archive? #97

Closed
davidperezgar opened this issue Jul 9, 2024 · 6 comments
Closed

How to run composer install before make the dist archive? #97

davidperezgar opened this issue Jul 9, 2024 · 6 comments

Comments

@davidperezgar
Copy link

Hello!
I love this command and I'm using a lot.
I'd need run composer before makes the dist archive. How could approach that?

@swissspidy
Copy link
Member

Since it's just a fancy way of making a zip file, there isn't really any special way for doing that.

cd my-project
composer install
wp dist-archive .
@ernilambar
Copy link
Member

ernilambar commented Jul 9, 2024

This will also include the package which is not needed in production. So to avoid this, you can use separate folder as base folder to archive.

Example: https://pascalbirchler.com/phpstan-wordpress/

@davidperezgar
Copy link
Author

Obviously I was thinking in the same command

@swissspidy
Copy link
Member

WP-CLI is all about composability. If you want to run composer before zipping, then run composer before dist-archive. Why doesn't that work for you?

@ernilambar
Copy link
Member

I added dist archive as composer dev dependency. That is why.

@davidperezgar
Copy link
Author

No problem, thanks. I concatenate the command, and it working fine.

composer update --no-dev --working-dir=wp-content/plugins/plugin && wp dist-archive wp-content/plugins/plugin ~/projects/ --filename-format={name}-{version}

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