(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string)
| 174 | } |
| 175 | |
| 176 | func runConfig(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) (err error) { |
| 177 | var content []byte |
| 178 | if opts.noInterpolate { |
| 179 | content, err = runConfigNoInterpolate(ctx, dockerCli, opts, services) |
| 180 | if err != nil { |
| 181 | return err |
| 182 | } |
| 183 | } else { |
| 184 | content, err = runConfigInterpolate(ctx, dockerCli, opts, services) |
| 185 | if err != nil { |
| 186 | return err |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | if !opts.noInterpolate { |
| 191 | content = escapeDollarSign(content) |
| 192 | } |
| 193 | |
| 194 | if opts.quiet { |
| 195 | return nil |
| 196 | } |
| 197 | |
| 198 | if opts.Output != "" && len(content) > 0 { |
| 199 | return os.WriteFile(opts.Output, content, 0o666) |
| 200 | } |
| 201 | _, err = fmt.Fprint(dockerCli.Out(), string(content)) |
| 202 | return err |
| 203 | } |
| 204 | |
| 205 | func runConfigInterpolate(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) ([]byte, error) { |
| 206 | backend, err := compose.NewComposeService(dockerCli) |
no test coverage detected