diff --git a/bin/compose-core b/bin/compose-core index 43f2d09..273d385 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3045,15 +3045,19 @@ export -f _save get_default_project_name() { - if [ "$DEFAULT_PROJECT_NAME" ]; then + local normalized_path compose_yml_location name + if [ -n "$DEFAULT_PROJECT_NAME" ]; then echo "$DEFAULT_PROJECT_NAME" return 0 fi compose_yml_location="$(get_compose_yml_location)" || return 1 - if [ "$compose_yml_location" ]; then + if [ -n "$compose_yml_location" ]; then if normalized_path=$(readlink -f "$compose_yml_location"); then - name="$(basename "$(dirname "$normalized_path")")" - echo "${name%%-deploy}" + ## XXX: + name="${normalized_path%/*}" ## dirname + name="${name##*/}" ## basename + name="${name%%-deploy}" ## remove any '-deploy' + name="${name,,}" ## lowercase return 0 fi fi