Output the original raw manifest in (skopeo inspect --raw)

We need (skopeo inspect --raw > manifest.json) to save the unmodified
original: no extra new lines, no undetected truncation, nothing.
This commit is contained in:
Miloslav Trmač
2016-08-16 17:50:17 +02:00
parent 91b722fec8
commit e4315e82b0

View File

@@ -44,7 +44,10 @@ var inspectCmd = cli.Command{
return err return err
} }
if c.Bool("raw") { if c.Bool("raw") {
fmt.Fprintln(c.App.Writer, string(rawManifest)) _, err := c.App.Writer.Write(rawManifest)
if err != nil {
return fmt.Errorf("Error writing manifest to standard output: %v", err)
}
return nil return nil
} }
imgInspect, err := img.Inspect() imgInspect, err := img.Inspect()