Merge pull request #10062 from ndeloof/9554

load project from files when explicitly set by user
This commit is contained in:
Guillaume Lours 2022-12-15 15:50:36 +01:00 committed by GitHub
commit aa0720f7e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")