Skip to content

Commit

Permalink
Updated checks for MS to quietly grep to avoid errors being printed o…
Browse files Browse the repository at this point in the history
…n Darwin systems (no /proc on macOS)
  • Loading branch information
davidalger committed Aug 25, 2020
1 parent 7474e4f commit d01ec04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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 || "$(< /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
3 changes: 2 additions & 1 deletion commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ if [[ ${WARDEN_ENV_TYPE} == "magento2" ]]; then
WARDEN_RABBITMQ=${WARDEN_RABBITMQ:-1}
fi

if [[ ${XDEBUG_CONNECT_BACK_HOST} == '' && "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then
## 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

Expand Down

0 comments on commit d01ec04

Please sign in to comment.