Browse Source

fix: support running in directory having name containing uppercase

The direct parent could be used to make the default project name,
and uppercase are not supported for container names.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
lokavaluto/dev/master
Valentin Lab 5 years ago
parent
commit
9b6c1f8613
  1. 12
      bin/compose-core

12
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

Loading…
Cancel
Save