Skip to content

Commit

Permalink
Merge pull request #186 from Automattic/update/devtools
Browse files Browse the repository at this point in the history
refactor(dev-tools): `_REMOTE_USER` must be set
  • Loading branch information
sjinks authored May 27, 2024
2 parents 731ced3 + f5008b9 commit 30449f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion features/src/dev-tools/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dev-tools",
"name": "Dev Tools",
"version": "1.0.1",
"version": "1.0.2",
"description": "Installs Development tools into the Dev Environment",
"installsAfter": [
"ghcr.io/automattic/vip-codespaces/vip-go-mu-plugins"
Expand Down
10 changes: 3 additions & 7 deletions features/src/dev-tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ if [ "$(id -u || true)" -ne 0 ]; then
exit 1
fi

if [ -z "${_REMOTE_USER}" ] || [ "${_REMOTE_USER}" = "root" ]; then
WEB_USER=www-data
else
WEB_USER="${_REMOTE_USER}"
fi
: "${_REMOTE_USER:?"_REMOTE_USER is required"}"

echo '(*) Installing Dev Tools...'

install -d -D -m 0755 -o "${WEB_USER}" -g "${WEB_USER}" /wp/wp-content/mu-plugins
install -m 0644 -o "${WEB_USER}" -g "${WEB_USER}" dev-env-plugin.php /wp/wp-content/mu-plugins/dev-env-plugin.php
install -d -D -m 0755 -o "${_REMOTE_USER}" -g "${_REMOTE_USER}" /wp/wp-content/mu-plugins
install -m 0644 -o "${_REMOTE_USER}" -g "${_REMOTE_USER}" dev-env-plugin.php /wp/wp-content/mu-plugins/dev-env-plugin.php

echo 'Done!'

0 comments on commit 30449f4

Please sign in to comment.