Skip to content

Bash example for wp core is-installed is not quite right #152

@lilole

Description

@lilole

The docs at https://developer.wordpress.org/cli/commands/core/is-installed/#examples show an example like this:

# Bash script for checking whether WordPress is installed or not
if ! $(wp core is-installed); then
    wp core install
fi

But that if is not right. It's testing whether the stdout of the wp core is-installed command is true or false.

The fix is simple, just remove the command substitution, like:

if ! wp core is-installed; then
    wp core install
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions