diff --git a/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy b/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy index 2a7abce..4a949c4 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy @@ -97,10 +97,10 @@ abstract class ComposeSettings { return customProjectName } else if (projectNamePrefix) { - return "${projectNamePrefix}_${nestedName}" + return nestedName ? "${projectNamePrefix}_${nestedName}" : projectNamePrefix } else { - return "${safeProjectNamePrefix}_${nestedName}" + return nestedName ? "${safeProjectNamePrefix}_${nestedName}" : safeProjectNamePrefix } }).map{ String projectName -> // docker-compose project names must be lowercase