reg/digest.go
Jess Frazelle 307f7c8400
cleanup
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-06 14:24:58 -04:00

33 lines
511 B
Go

package main
import (
"fmt"
"github.com/genuinetools/reg/repoutils"
"github.com/urfave/cli"
)
var digestCommand = cli.Command{
Name: "digest",
Usage: "get the digest",
Action: func(c *cli.Context) error {
if len(c.Args()) < 1 {
return fmt.Errorf("pass the name of the repository")
}
repo, ref, err := repoutils.GetRepoAndRef(c.Args()[0])
if err != nil {
return err
}
digest, err := r.Digest(repo, ref)
if err != nil {
return err
}
fmt.Println(digest)
return nil
},
}