Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
implement duffle inspect --raw (#523)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fisher <[email protected]>
  • Loading branch information
Matthew Fisher authored Nov 27, 2018
1 parent 17694f5 commit 67387dc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/duffle/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package main

import (
"io"
"os"

"github.com/spf13/cobra"
)

func newInspectCmd(w io.Writer) *cobra.Command {
var (
insecure bool
raw bool
)

const usage = ` Returns information about an application bundle.
Expand All @@ -33,6 +35,16 @@ func newInspectCmd(w io.Writer) *cobra.Command {
return err
}

if raw {
f, err := os.Open(bundleFile)
if err != nil {
return err
}
defer f.Close()
_, err = io.Copy(w, f)
return err
}

bun, err := loadBundle(bundleFile, insecure)
if err != nil {
return err
Expand All @@ -46,6 +58,7 @@ func newInspectCmd(w io.Writer) *cobra.Command {

flags := cmd.Flags()
flags.BoolVarP(&insecure, "insecure", "k", false, "Do not verify the bundle (INSECURE)")
flags.BoolVarP(&raw, "raw", "r", false, "Display the raw bundle manifest")

return cmd
}

0 comments on commit 67387dc

Please sign in to comment.