Skip to content

Commit 33cb671

Browse files
committed
feat: setProjectName accepts null or empty value as reset Fixes #362
1 parent 9f02019 commit 33cb671

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ abstract class ComposeSettings {
7070
protected Boolean customProjectNameSet
7171
protected String safeProjectNamePrefix
7272
void setProjectName(String customProjectName) {
73-
this.customProjectName = customProjectName
74-
this.customProjectNameSet = true
73+
if (customProjectName == null || customProjectName.isEmpty()) {
74+
this.customProjectName = null
75+
this.customProjectNameSet = false
76+
} else {
77+
this.customProjectName = customProjectName
78+
this.customProjectNameSet = true
79+
}
7580
}
7681
private Provider<String> projectNameProvider
7782
Provider<String> getProjectName() {

0 commit comments

Comments
 (0)