0

I'm using Valet Linux & Bedrock. I'm trying to get active plugins via the WP CLI.

When I run either of these from my terminal, they work just fine:

cd {my-local-project-root} db check
wp db check --allow-root --path={my-local-project-root}/web/wp

When I try to run the following deployer task:

task('wp:check-cli-local', function () {
    
$output = runLocally("bash -l -c 'wp db check'");

    writeln("WP-CLI Output:\n" . $output);
});

It doesn't work and it outputs:

$:~/{my-local-project-root} dep wp:check-cli-local
task wp:check-cli-local
    [my-env]  error  in deploy.php on line 81:
    [my-env] run wp db check --allow-root --path={my-local-project-root}/web/wp
    [my-env] err Info: Using unique option prefix 'pass' is error-prone and can break in the future. Please use the full name 'password' instead.
    [my-env] err mysqlcheck: Got error: 1698: Access denied for user '{my-user}'@'localhost' when trying to connect
    [my-env] exit code 2 (Misuse of shell builtins)

I'm guessing that when I run my task, it's not pulling the .env values, but I'm lost on how to proceed.


I want to run wp db check locally via deployer.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.