load project from explicit --files when set

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2022-12-14 23:22:01 +01:00 committed by Guillaume Lours
parent 1b1f783e99
commit 84984864c8
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ func (o *projectOptions) addProjectFlags(f *pflag.FlagSet) {
func (o *projectOptions) projectOrName(services ...string) (*types.Project, string, error) {
name := o.ProjectName
var project *types.Project
if o.ProjectName == "" {
if len(o.ConfigPaths) > 0 || o.ProjectName == "" {
p, err := o.toProject(services)
if err != nil {
envProjectName := os.Getenv("COMPOSE_PROJECT_NAME")