| 267 | } |
| 268 | |
| 269 | func (o *ProjectOptions) toProjectName(ctx context.Context, dockerCli command.Cli) (string, error) { |
| 270 | if o.ProjectName != "" { |
| 271 | return o.ProjectName, nil |
| 272 | } |
| 273 | |
| 274 | envProjectName := os.Getenv(ComposeProjectName) |
| 275 | if envProjectName != "" { |
| 276 | return envProjectName, nil |
| 277 | } |
| 278 | |
| 279 | backend, err := compose.NewComposeService(dockerCli) |
| 280 | if err != nil { |
| 281 | return "", err |
| 282 | } |
| 283 | |
| 284 | project, _, err := o.ToProject(ctx, dockerCli, backend, nil) |
| 285 | if err != nil { |
| 286 | return "", err |
| 287 | } |
| 288 | return project.Name, nil |
| 289 | } |
| 290 | |
| 291 | func (o *ProjectOptions) ToModel(ctx context.Context, dockerCli command.Cli, services []string, po ...cli.ProjectOptionsFn) (map[string]any, error) { |
| 292 | remotes := o.remoteLoaders(dockerCli) |