diff scripts/.functions.sh @ 266:b72855a930f1

simplify method of getting project name
author smith@nwoca.org
date Mon, 12 Nov 2018 21:12:31 +0000
parents c3587159637f
children d6d8468441b1
line wrap: on
line diff
--- a/scripts/.functions.sh	Thu Jul 26 14:27:43 2018 +0100
+++ b/scripts/.functions.sh	Mon Nov 12 21:12:31 2018 +0000
@@ -34,7 +34,6 @@
 # finds docker container for specified compose service 
 composeGetContainer() {
   service=${1?"Must supply service from current project"}
-
   container=$( docker-compose ps | cut -d " " -f 1 -s | grep _${service}_ )
   echo $container
 }
@@ -47,7 +46,6 @@
 }
 
 composeGetProject() {  
-  service=${1?"Must supply service from current project"}
-  container=$(composeGetContainer $service)
-  echo $(docker inspect -f '{{index .Config.Labels "com.docker.compose.project" }}' $container)
+  project=$( docker-compose ps | tail -n1 | cut -d "_" -f 1 -s )
+  echo $project
 }