Takes COMPOSE_PROJECT_NAME into consideration on commands

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2022-03-31 14:26:16 +02:00
parent 934b596e00
commit eee0e8bed9
1 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,11 @@ func (o *projectOptions) toProjectName() (string, error) {
return o.ProjectName, nil
}
envProjectName := os.Getenv("COMPOSE_PROJECT_NAME")
if envProjectName != "" {
return envProjectName, nil
}
project, err := o.toProject(nil)
if err != nil {
return "", err