From e4315e82b0a6eb7b7203442bee182765c5d20f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 16 Aug 2016 17:50:17 +0200 Subject: [PATCH] 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. --- cmd/skopeo/inspect.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/skopeo/inspect.go b/cmd/skopeo/inspect.go index 6414a178..6c5f4b7c 100644 --- a/cmd/skopeo/inspect.go +++ b/cmd/skopeo/inspect.go @@ -44,7 +44,10 @@ var inspectCmd = cli.Command{ return err } 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 } imgInspect, err := img.Inspect()