Skip to content

Commit

Permalink
Improve documentation for core is-installed command (#237)
Browse files Browse the repository at this point in the history
* improve documentation for core is-installed command

* Regenerate README

* Fix PHPCS issues

---------

Co-authored-by: Daniel Bachhuber <[email protected]>
  • Loading branch information
petertwise and danielbachhuber committed Jul 11, 2023
1 parent 893e18d commit 169625a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
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

0 comments on commit 169625a

Please sign in to comment.