From d04163c17981d21d46a5a3c5bc5558a4bf253b80 Mon Sep 17 00:00:00 2001 From: Madison Swain-Bowden Date: Wed, 22 Sep 2021 16:37:15 -0700 Subject: [PATCH] Add instructions for installing plugins/themes --- packages/env/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/env/README.md b/packages/env/README.md index b9f549e1fbdc4..921c4da7aeb38 100644 --- a/packages/env/README.md +++ b/packages/env/README.md @@ -350,6 +350,29 @@ wp> ^C ✔ Ran `wp shell` in 'tests-cli'. (in 16s 400ms) ``` +#### Installing a plugin or theme on the development instance + +```sh +wp-env run cli plugin install custom-post-type-ui + +Creating 500cd328b649d63e882d5c4695871d04_cli_run ... done +Installing Custom Post Type UI (1.9.2) +Downloading installation package from https://downloads.wordpress.org/plugin/custom-post-type-ui.zip... +The authenticity of custom-post-type-ui.zip could not be verified as no signature was found. +Unpacking the package... +Installing the plugin... +Plugin installed successfully. +Success: Installed 1 of 1 plugins. +✔ Ran `plugin install custom-post-type-ui` in 'cli'. (in 6s 483ms) +``` + +**NOTE**: Depending on your host OS, you may experience errors when trying to install plugins or themes (e.g. `Warning: Could not create directory.`). This is typically because the user ID used within the container does not have write access to the mounted directories created by `wp-env`. To resolve this, run the `docker-compose` command directly from the directory created by `wp-env` and add `-u $(id -u)` and `-e HOME=/tmp` the `run` command as options: + +```sh +$ cd ~/wp-env/500cd328b649d63e882d5c4695871d04 +$ docker-compose run --rm -u $(id -u) -e HOME=/tmp cli [plugin|theme] install +``` + ### `wp-env destroy` ```sh