Skip to content

Commit

Permalink
Merge pull request #213 from ihor-sviziev/patch-1
Browse files Browse the repository at this point in the history
Add wsl2 support for warden
  • Loading branch information
davidalger authored Aug 25, 2020
2 parents cfed9c6 + f76e7cc commit 56899ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd)
[All Commits](https://github.com/davidalger/warden/compare/0.9.0..develop)

**Bug Fixes:**

* Fixed bug on WSL2 where Xdebug connect back host was improperly set ([#213](https://github.com/davidalger/warden/pull/213) by @iihor-sviziev)

## Version [0.9.0](https://github.com/davidalger/warden/tree/0.9.0) (2020-08-06)
[All Commits](https://github.com/davidalger/warden/compare/0.8.2..0.9.0)

Expand Down
2 changes: 1 addition & 1 deletion commands/debug.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WARDEN_ENV_DEBUG_CONTAINER=${WARDEN_ENV_DEBUG_CONTAINER:-php-debug}
WARDEN_ENV_DEBUG_HOST=${WARDEN_ENV_DEBUG_HOST:-}

if [[ ${WARDEN_ENV_DEBUG_HOST} == "" ]]; then
if [[ $OSTYPE =~ ^darwin || "$(< /proc/sys/kernel/osrelease)" == *Microsoft ]]; then
if [[ $OSTYPE =~ ^darwin ]] || grep -sqi microsoft /proc/sys/kernel/osrelease; then
WARDEN_ENV_DEBUG_HOST=host.docker.internal
else
WARDEN_ENV_DEBUG_HOST=$(
Expand Down
5 changes: 5 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ if [[ ${WARDEN_ENV_TYPE} == "magento2" ]]; then
WARDEN_RABBITMQ=${WARDEN_RABBITMQ:-1}
fi

## WSL1/WSL2 are GNU/Linux env type but still run Docker Desktop
if [[ ${XDEBUG_CONNECT_BACK_HOST} == '' ]] && grep -sqi microsoft /proc/sys/kernel/osrelease; then
export XDEBUG_CONNECT_BACK_HOST=host.docker.internal
fi

## configure docker-compose files
DOCKER_COMPOSE_ARGS=()

Expand Down

0 comments on commit 56899ef

Please sign in to comment.