File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed
Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,10 @@ Usage: itkdev-docker-compose command [command arguments]
113113
114114Commands:
115115
116- url
117- Print url to site
116+ url [service [port]]
117+ Print url to site or a service
118118
119- open
119+ open [service [port]]
120120 Open url in default browser
121121
122122 drush
@@ -289,11 +289,31 @@ shift
289289
290290case " $cmd " in
291291 url)
292- echo http://${COMPOSE_DOMAIN}
292+ domain=${COMPOSE_DOMAIN}
293+ if [ " $# " -gt 0 ]; then
294+ service=" $1 "
295+ port=80
296+
297+ shift
298+ if [ " $# " -gt 0 ]; then
299+ port=" $1 "
300+ shift
301+ fi
302+
303+ domain=$( docker_compose port $service $port )
304+ if [ $? -ne 0 ]; then
305+ exit 1
306+ elif [ -z " $domain " ]; then
307+ (>&2 echo " Cannot find domain for service $service (port: $port )" )
308+ exit 1
309+ fi
310+ fi
311+
312+ echo http://$domain
293313 ;;
294314
295315 open)
296- open $( $script_path url)
316+ open $( $script_path url " $@ " )
297317 ;;
298318
299319 sync)
You can’t perform that action at this time.
0 commit comments