File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -411,22 +411,25 @@ _verifyListableEntity() {
411411#
412412
413413_getComposeProjectName () {
414- _checkCWDProject
414+ local projectDir= " ${1} "
415415
416- echo " ${CWD_PROJECT_ROOT ##*/ } " | tr " [:upper:]" " [:lower:]"
416+ echo " ${projectDir ##*/ } " | tr " [:upper:]" " [:lower:]"
417417}
418418_getServicePorts () {
419- _checkCWDProject
420-
421- local serviceName=" ${1} "
419+ local projectDir=" ${1} "
420+ local serviceName=" ${2} "
422421 # shellcheck disable=SC2016
423422 local template=' table NAME\tCONTAINER PORT\tHOST PORT\n{{$name := .Name}}{{range .Publishers}}{{if eq .URL "0.0.0.0"}}{{$name}}\t{{.TargetPort}}\tlocalhost:{{.PublishedPort}}\n{{end}}{{end}}'
424423
425- if [[ " ${serviceName} " ]]; then
426- docker compose ps " ${serviceName} " --format " ${template} " | tail -n +3
427- else
428- docker compose ps --format " ${template} " | tail -n +3
429- fi
424+ (
425+ cd " ${projectDir} " || exit 1
426+
427+ if [[ " ${serviceName} " ]]; then
428+ docker compose ps " ${serviceName} " --format " ${template} " | tail -n +3
429+ else
430+ docker compose ps --format " ${template} " | tail -n +3
431+ fi
432+ )
430433}
431434_getWorktreeDir () {
432435 local worktree_name=" ${1} "
You can’t perform that action at this time.
0 commit comments