Skip to content

Commit

Permalink
Fix ddev exec message offered to wp users on import (#1014)
Browse files Browse the repository at this point in the history
* Fix ddev exec message offered to wp users on import

* Improve some sample hook docs

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.
  • Loading branch information
rfay committed Jul 27, 2018
1 parent a9ed0c3 commit 4466584
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/ddevapp/backdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func getBackdropUploadDir(app *DdevApp) string {
func getBackdropHooks() []byte {
backdropHooks := `
# post-import-db:
# - exec: "drush cc all"`
# - exec: drush cc all`
return []byte(backdropHooks)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func TestWriteConfig(t *testing.T) {

out, err = ioutil.ReadFile(filepath.Join(testDir, "config.yaml"))
assert.NoError(err)
assert.Contains(string(out), `exec: "wp search-replace`)
assert.Contains(string(out), `- exec: wp search-replace`)

err = os.RemoveAll(testDir)
assert.NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/drupal.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const Drupal8Hooks = `
// Drupal7Hooks adds a d7-specific hooks example for post-import-db
const Drupal7Hooks = `
# post-import-db:
# - exec: "drush cc all"`
# - exec: drush cc all`

// getDrupal7Hooks for appending as byte array
func getDrupal7Hooks() []byte {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/typo3.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func getTypo3UploadDir(app *DdevApp) string {
// Typo3Hooks adds a TYPO3-specific hooks example for post-import-db
const Typo3Hooks = `
# post-start:
# - exec: "composer install -d /var/www/html"`
# - exec: composer install -d /var/www/html`

// getTypo3Hooks for appending as byte array
func getTypo3Hooks() []byte {
Expand Down
6 changes: 3 additions & 3 deletions pkg/ddevapp/wordpress.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func NewWordpressConfig() *WordpressConfig {
const wordPressHooks = `
# Un-comment and enter the production url and local url
# to replace in your database after import.
#post-import-db:
# - exec: "wp search-replace <production-url> <local-url>"`
# post-import-db:
# - exec: wp search-replace <production-url> <local-url>`

// getWordpressHooks for appending as byte array
func getWordpressHooks() []byte {
Expand Down Expand Up @@ -200,6 +200,6 @@ func isWordpressApp(app *DdevApp) bool {
// wordpressPostImportDBAction just emits a warning about updating URLs as is
// required with wordpress when running on a different URL.
func wordpressPostImportDBAction(app *DdevApp) error {
util.Warning("Wordpress sites require a search/replace of the database when the URL is changed. You can run \"ddev exec 'wp search-replace [http://www.myproductionsite.example] %s'\" to update the URLs across your database. For more information, see http://wp-cli.org/commands/search-replace/", app.GetHTTPURL())
util.Warning("Wordpress sites require a search/replace of the database when the URL is changed. You can run \"ddev exec wp search-replace [http://www.myproductionsite.example] %s\" to update the URLs across your database. For more information, see http://wp-cli.org/commands/search-replace/", app.GetHTTPURL())
return nil
}

0 comments on commit 4466584

Please sign in to comment.