You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wp-now: Add executeWPCli() function to download and execute WP-CLI (#395)
## What?
- Add the `executeWPCli` function to download and execute `wp-cli.
- In the future, we may include the command `wp-now wp`. Currently, we
drop it out until we improve the pthreads execution. Currently a PR in
progress: #346
- Surface `emscriptenOptions` to catch print and print error for
`wp-cli` execution.
## Why?
- See https://github.com/WordPress/wordpress-playground/issues/269
## How?
It downloads the wp-cli.phar file if the file doesn't exist, then uses
`php.cli()` to execute it.
There are some limitations in the `wp-cli` features. Some of them may
not work.
## Testing Instructions
- Check out this branch.
- Copy your path to your theme or plugin
- After installing and building the project, run:
- Run the tests `npx nx test wp-now`
- Observe the tests pass.
<!--details>
<summary>~`WP_NOW_PROJECT_PATH=/path/to/your-theme-or-plugin npx nx
preview wp-now wp user list`~ </summary>
```
> nx run wp-now:preview wp user list
+----+------------+--------------+--------------+--------------+---------------+
| ID | user_login | display_name | user_email | user_registe | roles |
| | | | | red | |
+----+------------+--------------+--------------+--------------+---------------+
| 1 | admin | admin | admin@localh | 2023-05-19 1 | administrator |
| | | | ost.com | 7:33:35 | |
+----+------------+--------------+--------------+--------------+---------------+
> NX Successfully ran target preview for project wp-now and 12 tasks it depends on (10s)
With additional flags:
wp user list
```
</details!-->
---------
Co-authored-by: Daniel Bachhuber <[email protected]>
0 commit comments