Skip to content

Commit

Permalink
Do script shell part improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph3nol committed Oct 13, 2017
1 parent 32ce9cc commit ff8aec4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Application/Resources/views/Base/do.twig
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ DOCKER_CLI_CONTAINERS_IDENTIFIERS=({% for service in project.cliServices %}"{{ s
DOCKER_CLI_CONTAINERS_SHELLS=({% for service in project.cliServices %}"{{ service.options.zsh|default(false) ? 'zsh': 'bash' }}"{% if not loop.last %} {% endif %}{% endfor %})
INDEX=1
echo "Choose the container instance to access its bash/zsh shell:"
UP_CONTAINERS=$($DOCKER_COMPOSE_COMMAND ps | sed 1,2d | grep Up)
for DOCKER_CONTAINER_IDENTIFIER in "${DOCKER_CLI_CONTAINERS_IDENTIFIERS[@]}"
do
CONTAINER_STATUS=$($DOCKER_COMPOSE_COMMAND ps | sed 1,2d | grep Up | grep $DOCKER_CONTAINER_IDENTIFIER | cut -d ' ' -f1)
CONTAINER_STATUS=$(echo "$UP_CONTAINERS" | grep $DOCKER_CONTAINER_IDENTIFIER | cut -d ' ' -f1)
CONTAINER_STATUS_DISPLAY=$(if [ "$CONTAINER_STATUS" == "" ]; then echo "NOT AVAILABLE"; else echo "AVAILABLE"; fi)
SHELL_TYPE=${DOCKER_CLI_CONTAINERS_SHELLS[$INDEX - 1]}
echo " > $INDEX - $DOCKER_CONTAINER_IDENTIFIER [$SHELL_TYPE] [$CONTAINER_STATUS_DISPLAY]"
Expand Down

0 comments on commit ff8aec4

Please sign in to comment.