Commit ffce0f93 authored by larryeitel's avatar larryeitel

Fix: ERROR: expr: syntax error #272

parent a2d154c3
...@@ -6,12 +6,21 @@ ...@@ -6,12 +6,21 @@
# Grab full name of php-fpm container # Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d" " -f 1) PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d" " -f 1)
# Grab OS type
if [[ "$(uname)" == "Darwin" ]]; then
OS_TYPE="OSX"
else
OS_TYPE=$(expr substr $(uname -s) 1 5)
fi
xdebug_status () xdebug_status ()
{ {
echo 'xDebug status' echo 'xDebug status'
# If running on Windows, need to prepend with winpty :( # If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else else
...@@ -20,6 +29,7 @@ xdebug_status () ...@@ -20,6 +29,7 @@ xdebug_status ()
} }
xdebug_start () xdebug_start ()
{ {
echo 'Start xDebug' echo 'Start xDebug'
...@@ -30,7 +40,7 @@ xdebug_start () ...@@ -30,7 +40,7 @@ xdebug_start ()
# If running on Windows, need to prepend with winpty :( # If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker restart $PHP_FPM_CONTAINER docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
...@@ -40,9 +50,9 @@ xdebug_start () ...@@ -40,9 +50,9 @@ xdebug_start ()
docker restart $PHP_FPM_CONTAINER docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi fi
} }
xdebug_stop () xdebug_stop ()
{ {
echo 'Stop xDebug' echo 'Stop xDebug'
...@@ -52,7 +62,7 @@ xdebug_stop () ...@@ -52,7 +62,7 @@ xdebug_stop ()
# If running on Windows, need to prepend with winpty :( # If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then if [[ $OS_TYPE == "MINGW" ]]; then
# This is the equivalent of: # This is the equivalent of:
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla' # winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593 # Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment