wp-cli / scaffold-command

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.
MIT License
165 stars 87 forks source link

Use longer option names in `install_db()` to avoid stalling CIs #255

Closed stevegrunwell closed 4 years ago

stevegrunwell commented 4 years ago

Since some platforms (such as Travis CI) use empty passwords for the database user, passing an empty string for $DB_PASS can result in a TTY prompt, e.g.:

$ DB_USER=someuser DB_PASS="" mysql -u "$DB_USER" -p"$DB_PASS" -e 'show databases;'
Enter password:

In a CI environment, this can cause the entire pipeline to hang until cancelled.

This PR rewrites the call to use the longer option names (--user, --password, and --execute) to prevent empty passwords from being interpreted as "please ask me to provide my password in an interactive prompt."

schlessera commented 4 years ago

Thanks for the PR, @stevegrunwell !