mirror of
https://github.com/docker/compose.git
synced 2026-02-09 01:59:22 +08:00
fix compose config --format json
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
@@ -160,7 +160,15 @@ func runConfig(ctx context.Context, dockerCli command.Cli, opts configOptions, s
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
content, err = project.MarshalYAML()
|
||||
|
||||
switch opts.Format {
|
||||
case "json":
|
||||
content, err = project.MarshalJSON()
|
||||
case "yaml":
|
||||
content, err = project.MarshalYAML()
|
||||
default:
|
||||
return fmt.Errorf("unsupported format %q", opts.Format)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user