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

Improve documentation for core is-installed command #237

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,23 @@ to communicate whether WordPress is installed.

**EXAMPLES**

# Check whether WordPress is installed; exit status 0 if installed, otherwise 1
$ wp core is-installed
$ echo $?
1
# Bash script for checking if WordPress is not installed

# Bash script for checking whether WordPress is installed or not
if ! wp core is-installed; then
if ! wp core is-installed 2>/dev/null; then
# WP is not installed. Let's try installing it.
wp core install
fi

# Bash script for checking if WordPress is installed, with fallback

if wp core is-installed 2>/dev/null; then
# WP is installed. Let's do some things we should only do in a confirmed WP environment.
wp core verify-checksums
else
# Fallback if WP is not installed.
echo 'Hey Friend, you are in the wrong spot. Move in to your WordPress directory and try again.'
fi



### wp core multisite-convert
Expand Down
20 changes: 14 additions & 6 deletions src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,23 @@ function () use ( $temp ) {
*
* ## EXAMPLES
*
* # Check whether WordPress is installed; exit status 0 if installed, otherwise 1
* $ wp core is-installed
* $ echo $?
* 1
* # Bash script for checking if WordPress is not installed
*
* # Bash script for checking whether WordPress is installed or not
* if ! wp core is-installed; then
* if ! wp core is-installed 2>/dev/null; then
* # WP is not installed. Let's try installing it.
* wp core install
* fi
*
* # Bash script for checking if WordPress is installed, with fallback
*
* if wp core is-installed 2>/dev/null; then
* # WP is installed. Let's do some things we should only do in a confirmed WP environment.
* wp core verify-checksums
* else
* # Fallback if WP is not installed.
* echo 'Hey Friend, you are in the wrong spot. Move in to your WordPress directory and try again.'
* fi

*
* @subcommand is-installed
*/
Expand Down
Loading