-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Fix ddev exec message offered to wp users on import #1014
Conversation
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.
Confirmed this worked. We could equally update the default config.yml to reflect the *.ddev.local naming convention.
#hooks:
Un-comment and enter the production url and local url
to replace in your database after import.
#post-import-db:
- exec: "wp search-replace "
Even without that recommendation, this is a +1 to pull.
7461bf7
to
f364903
Compare
A project-wide search for
Could these be updated as well? Update: It seems wrapping the command in quotes in a hook does work, so updating the results of the grep and the WordPress post-import-db command might not be required, but it might as well be updated everywhere. |
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.
Small note about similar suggestions elsewhere in docs, but these changes are approved
Interestingly enough, the command to exec works inside quotes when used as a hook, and in some cases the quotes improve things, I can't give an example though. I think we're better to offer it without quotes where it doesn't need them. |
Although the hook argument can be done with or without quotes, I agree it's less confusing to suggest doing it without quotes. Because "ddev exec" works only without quotes in most cases.
The Problem/Issue/Bug:
A user in slack pointed out that our prompted suggestion of wp search-replace results in an error because we quote it.
The prompt says
The result if you do that is:
ddev exec 'Failed to execute command [wp search-replace [http://www.myproductionsite.exampleto update the URLs across your da] http://wpsite.ddev.local]: Failed to run docker-compose [-f /Users/brentr obbins/wpsite/.ddev/docker-compose.yaml exec -T web wp search-repl ace [http://www.myproductionsite.example] http://wpsite.ddev.local], err='exit status 126', stdout='OCI runtime exec failed: exec failed: container_linux.go :348: starting container process caused "exec: \"wp search-replace [http://www.my productionsite.example] http://wpsite.ddev.local\": stat wp search-replace [http://www.myproductionsite.example] http://wpsite.ddev.local: no such file or directory": unknown ', stderr=''
Because ddev exec is trying to run an executable called "wp search-replace ..." instead of just running wp.
How this PR Solves The Problem:
Remove the quotes around the command.
Manual Testing Instructions:
Automated Testing Overview:
Related Issue Link(s):
Release/Deployment notes: