From 4bbcdade5936ee9d24d4538540080e49f01b1c85 Mon Sep 17 00:00:00 2001 From: Michael Priest Date: Tue, 27 Nov 2018 13:33:13 +1030 Subject: [PATCH] Simplify using docker-compose commands. (#54) --- dsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dsh b/dsh index df7ab00..8dc9499 100755 --- a/dsh +++ b/dsh @@ -56,7 +56,7 @@ Connecting via ./dsh shell and running robo build is a common next step." # Command: ./dsh shell # Connects a shell to the web image as the current user. dsh_shell() { - if ! docker ps | grep "\s${PROJECT}_web_1" > /dev/null; then + if docker-compose -f ${DOCKER_COMPOSE_FILE} ps --filter "status=stopped" --services | grep web > /dev/null; then notice "Project not running, starting." dsh_start fi @@ -83,9 +83,7 @@ dsh_purge() { # Command: ./dsh status # Shows status information about project containers. dsh_status() { - if ! docker ps | grep "\s${PROJECT}_"; then - notice "${PROJECT} not running." - fi + docker-compose -f ${DOCKER_COMPOSE_FILE} ps } # Command: ./dsh logs