Skip to content

Commit 40843e6

Browse files
committed
allow COMPOSE_PROFILES to be set by a multiline string
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 3c676fd commit 40843e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ func WithLoadOptions(loadOptions ...func(*loader.Options)) ProjectOptionsFn {
217217
// profiles specified via the COMPOSE_PROFILES environment variable otherwise.
218218
func WithDefaultProfiles(profile ...string) ProjectOptionsFn {
219219
if len(profile) == 0 {
220-
profile = strings.Split(os.Getenv(consts.ComposeProfiles), ",")
220+
for _, s := range strings.Split(os.Getenv(consts.ComposeProfiles), ",") {
221+
profile = append(profile, strings.TrimSpace(s))
222+
}
223+
221224
}
222225
return WithProfiles(profile)
223226
}

0 commit comments

Comments
 (0)