COMPOSE_COMPATIBILITY can be set by .env file

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-10-28 10:10:26 +02:00
parent b2d2c67032
commit c4cfaeb12a
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 4 additions and 3 deletions

View File

@ -176,6 +176,10 @@ func (o *projectOptions) toProject(services []string, po ...cli.ProjectOptionsFn
return nil, compose.WrapComposeError(err)
}
if o.Compatibility || project.Environment["COMPOSE_COMPATIBILITY"] == "true" {
compose.Separator = "_"
}
if len(services) > 0 {
s, err := project.GetServices(services...)
if err != nil {
@ -271,9 +275,6 @@ func RootCommand(backend api.Service) *cobra.Command {
opts.ProjectDir = opts.WorkDir
fmt.Fprint(os.Stderr, aec.Apply("option '--workdir' is DEPRECATED at root level! Please use '--project-directory' instead.\n", aec.RedF))
}
if opts.Compatibility || os.Getenv("COMPOSE_COMPATIBILITY") == "true" {
compose.Separator = "_"
}
return nil
},
}