-
Notifications
You must be signed in to change notification settings - Fork 4.5k
wp-env: add wp-cli config when creating environment #70661
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
Conversation
Size Change: 0 B Total Size: 1.89 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that works for me.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What if a project already has a |
Here in But it's true that |
@jsnajdr I'm not sure I understand. Running |
The confusing part is that
Jobs 1 and 3 are fine, the The whole logic can be figured out by tracking how the |
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
When configuring WordPress, both in the "normal" and "test" environments, let's add a project-local WP-CLI config for the environment that tells WP-CLI that Apache with mod_rewrite is being used. That is needed by WP-CLI when running commands like:
The
--hard
flag tells WP-CLI to flush the.htaccess
file but it won't do it unless configured. It will print a warning:The relevant usage docs are here: https://developer.wordpress.org/cli/commands/rewrite/structure/
I'm adding write of the config file to
setupCommands
inconfigureWordPress
. ThesetupCommands
array includes several calls to WP-CLI (wp core
,wp plugin
, ...) so it makes sense to configure it right at the very beginning.Testing instructions:
The bug we're fixing is that the following command will never write
.htaccess
and will print a warning instead:Verify that when you create a new env with this patch, this bug is fixed. No warning, and there's
.htaccess
in~/.wp-env/{hash}/WordPress
.